"category": "inspect-and-test",

JSONPath Tester & Evaluator

"tldr": Paste JSON, type a JSONPath expression, and see matching values live - wildcards, recursive descent, filters, and slices supported.

Test JSONPath expressions against your own JSON document with live results. The full syntax is supported: dot and bracket notation, wildcards ([*]), recursive descent (..), array slices ([0:2]), and filter expressions ([?(@.price < 35)]) - with a match count updating as you type.

{"tool": "jsonpath-tester"}

JSONPath is the query language you meet in Kubernetes (kubectl -o jsonpath), AWS CLI queries, Postman assertions, and countless ETL tools. Getting an expression right by trial and error inside those tools is slow - prototype it here first, then paste it where it needs to go.

How to test a JSONPath expression

  1. 1Paste your JSON document into the left panel, or click "Load sample" for a working example.
  2. 2Type a JSONPath expression in the query field - results update live with a match count.
  3. 3Matches are returned as a JSON array on the right, exactly as most libraries return them.
  4. 4Refine until the matches are right, then copy the expression into your kubectl query, Postman test, or code.

Convert JSON to Matches in code

JavaScript (jsonpath-plus)
import { JSONPath } from "jsonpath-plus"; // npm install jsonpath-plus

const titles = JSONPath({
  path: "$.store.book[?(@.price < 35)].title",
  json: data,
});
Python (jsonpath-ng)
from jsonpath_ng.ext import parse  # pip install jsonpath-ng

expr = parse("$.store.book[?(@.price < 35)].title")
titles = [m.value for m in expr.find(data)]

Frequently asked questions

What is the difference between $, @, and .. in JSONPath?

$ is the document root and starts every expression. @ is the current node inside a filter - [?(@.price < 35)] reads "where this element's price is under 35". The double dot .. is recursive descent: $..title finds "title" at any depth, not just one level down.

Why does my filter expression return nothing?

The three usual causes: applying a filter to an object instead of an array (filters iterate array elements), comparing a number against a string value ("35" vs 35 - JSONPath comparisons are type-sensitive), or a typo in the property name after @. Check what $.path[*] alone returns first, then add the filter.

Is JSONPath standardized - will my expression work everywhere?

Since 2024 there is an official standard, RFC 9535, but many implementations predate it and differ on edge cases (filter syntax, script expressions, union behavior). Core syntax - dot access, wildcards, recursive descent, simple filters - is portable. Test in the target tool for anything exotic.

How is JSONPath different from jq?

JSONPath selects nodes from a document; jq is a full transformation language with pipes, functions, and restructuring. If you only need to extract values, JSONPath is simpler and embedded in more tools. If you need to reshape the output, reach for jq.

Last updated:

You might also need

Free and in-browser, like everything on JSON Console. Browse all tools →