Query
JSONPath Tester
Write a JSONPath expression and see which parts of your JSON it matches, live. Pick an example to get started.
How to use it
- Paste your JSON, or press Sample for a small bookstore document.
- Type an expression in the JSONPath box, or choose one from Examples.
- Matches appear on the right. Turn on Show the path of each match to see where each value came from.
JSONPath syntax
| Expression | Meaning |
|---|---|
$ | The root of the document |
.key or ['key'] | A child key (use brackets for keys with spaces or symbols) |
[0] | An array item by index, starting at 0 |
[-1:] | The last item (a slice; negative numbers count from the end) |
[*] or .* | All items or all values |
..key | Recursive descent: key at any depth |
[0,2] | Several indexes |
[1:3] | A slice: items 1 and 2 |
[?(@.price < 10)] | A filter: items where the condition is true; @ is the current item |
Filters
Filters select array items by a condition. Compare with ==,
===, !=, <, >,
<= and >=, and combine conditions with &&
and ||. [?(@.isbn)] keeps items that have an isbn key.
For safety, filters run in a sandboxed evaluator, not as JavaScript code.
JSONPath was described by Stefan Goessner in 2007 and standardized as RFC 9535 in 2024. Implementations differ slightly in filter syntax; this tester uses the widely used jsonpath-plus library.
Frequently asked questions
What is the difference between JSONPath and jq?
JSONPath only selects values from a document. jq is a command-line language that can also transform, filter and build new JSON.
Why does my filter return nothing?
Check that the filter is applied to an array, for example $.store.book[?(@.price < 10)], and that strings are quoted inside the filter.
Is JSONPath standardized?
Yes, since RFC 9535 (2024). Older libraries, including this one, also accept some extra syntax from the original 2007 article.
Is my data uploaded?
No. Everything runs with JavaScript inside your browser tab. Nothing you paste is sent to a server or stored.