JSONPath Tester
Run JSONPath queries with filters and slices on your JSON and see each match.
About this tool
Paste your JSON, type a JSONPath expression, and every match appears with its value and normalised path. Example chips load common queries against the sample bookstore data. Errors in the JSON or the path are explained, and the results can be copied as a JSON array.
JSONPath syntax with examples
JSONPath queries JSON the way XPath queries XML, and was standardised as RFC 9535 in 2024. A query starts with $, the root. .name or ['name'] selects a member, [0] selects an array item, with negative numbers counting from the end, and [*] or .* selects every child. Two dots search all levels, so $..price finds every price in the document. [start:end:step] slices arrays, and [0,2] picks several items. Filters keep items that match a condition, where @ is the item being tested. In the sample store, $.store.book[?(@.price < 10)].title returns "Sayings of the Century" and "Moby Dick", $..book[?(@.isbn)] returns the two books that have an ISBN, and $..book[-1:] returns the last book. Conditions combine with && and ||, ! negates, and length() measures strings and arrays. Each result shows its normalised path, such as $['store']['book'][2]['title'], which tells you exactly how to reach the value in code. Honest limits: implementations differ on edge cases. Older libraries allowed arbitrary JavaScript in filters, while this tester follows the safer RFC-style syntax and never runs script. The JSON formatter tidies the input, the JSON diff compares documents and the JSON schema generator describes their structure. What JSON is, and where it trips people up covers the basics.
Frequently asked questions
What does $.. mean in JSONPath?
Recursive descent: it searches the current node and everything below it. $..price finds every price at any depth.
How do I filter in JSONPath?
Use [?( )] with @ for the current item, for example $.items[?(@.qty > 0 && @.status == 'active')].
What is the difference between JSONPath and jq?
JSONPath only selects values, and is now an IETF standard (RFC 9535). jq is a full command-line language that can also transform data.
Is my JSON uploaded?
No. Queries run in your browser and nothing is stored or sent.