What this does
Paste a JSON document, type a JSONPath expression, and see every match — its value and its full resolved path — update as you type. JSONPath is to JSON what a CSS selector is to HTML: instead of writing code to walk a document, a single expression like $..book[?(@.price<10)].title picks out exactly the nodes you want.
Syntax reference
| Syntax | Meaning |
|---|---|
$ | The root of the document. Every expression starts here. |
.name | Child property access, e.g. $.store.bicycle. |
..name | Recursive descent — finds name at any depth, e.g. $..author. |
* | Wildcard — every property of an object or every element of an array. |
[0], [-1] | Array index. Negative indices count from the end. |
[0,1] | Index union — multiple specific indices at once. |
[start:end:step] | Array slice, same semantics as Python slicing. |
[?(expr)] | Filter — keeps elements where expr is true. @ refers to the current element, e.g. [?(@.price<10)]. |
[(expr)] | Script expression evaluated against the current node, e.g. [(@.length-1)]. |
Common examples
Using the sample data loaded above:
$.store.book[*].author— every book's author.$..price— every price in the document, at any depth.$.store.book[?(@.price<20)].title— titles of books under $20.$..book[-1:]— the last book in the array.
FAQ
Why does an expression return no matches instead of an error?
A path segment that simply doesn't exist in the document (a typo'd property name, an out-of-range index) is not an error in JSONPath — it just matches nothing. An error is only shown when the expression itself can't be parsed, like an unterminated filter.
What implementation does this use?
This tool runs JSONPath Plus, a JavaScript implementation of Stefan Goessner's original JSONPath with filter expressions and script expressions added. Entirely in your browser — nothing you paste in is sent anywhere.
Try it yourself
Need to check the document's shape instead of querying into it? See JSON Formatter and JSON Schema Validator.