Query JSON like XPath queries XML
JSONPath is a small query language for selecting parts of a JSON document. It is used in API testing tools (Postman, REST Assured), Kubernetes (kubectl -o jsonpath), AWS Step Functions, monitoring tools and many SDKs. This evaluator lets you experiment with expressions against your own data and see the results immediately. Tick Show paths to see the normalised path of each match.
Syntax reference
| Expression | Meaning |
|---|---|
$ | the root of the document |
$.store.bicycle.color | child properties (dot notation) |
$['store']['book'] | bracket notation (for keys with spaces or symbols) |
$.store.book[0], [-1] | array index, negative counts from the end |
$.store.book[0,2] | union of several indexes or keys |
$.store.book[1:3], [-2:] | array slice (start inclusive, end exclusive) |
$.store.book[*].author | wildcard: all items or all properties |
$..price | recursive descent: every price at any depth |
$..book[?(@.isbn)] | filter: items that have an isbn |
$..book[?(@.price < 10 && @.category == 'fiction')] | filter with comparison and logic |
$..book[?(@.author =~ /^J/)] | filter with a regular expression |
$.store.book.length | number of items in an array |
Filters support ==, !=, <, <=, >, >=, =~ (regex), &&, ||, ! and parentheses. Inside a filter, @ is the current item and $ is the document root. Filters are evaluated by a built-in parser — no code from the expression is ever executed.
Example
Expression
$..book[?(@.price < 10)].titleResult
[
"Sayings of the Century",
"Moby Dick"
]Frequently asked questions
Which JSONPath dialect is supported?
The common Goessner-style syntax that most libraries share (and that RFC 9535 standardises), including filters, slices, unions and recursive descent. Script expressions like (@.length-1) are not supported; use [-1] instead.
Why do I get an empty array?
No node matched. Check the spelling and letter case of keys — JSONPath is case-sensitive — and remember that array items need [*] or an index.
How do I select a key that contains a dot or space?
Use bracket notation with quotes, e.g. $['first name'].
Is my JSON uploaded?
No. Queries are evaluated in your browser.