JSONPath tester
Runs in your browser; nothing is uploaded
Test a JSONPath expression against JSON and see every match with its path. Filters, slices, recursive descent and the standard functions of RFC 9535 are supported. Nothing is sent.
JSON
Matches
Nothing yet
How JSONPath works
JSONPath picks values out of JSON, the way XPath does for XML. $ is the whole document; .name or ['name'] goes into a property; [0] takes an array item and [-1] the last one. API testing tools use it to read values from responses: Postman, REST Assured, Karate, JMeter and Kubernetes' kubectl all speak a dialect of it.
Two operators do most of the work. .. searches at every depth, so $..id finds every id in the document. ? filters, keeping items for which a condition holds: $.orders[?@.total > 100] keeps orders over 100, where @ is the item being tested. Conditions combine with &&, || and !, and ?@.isbn alone keeps items that have an isbn.
This tester follows RFC 9535, the 2024 standard, including slices [start:end:step], unions [0,2], and the functions length(), count(), match() and search(). Older tools differ in places (some want ?(@.price<10) with parentheses, which also works here), so check a path here before relying on it.
How to use this tool
- 1Type a JSONPath at the top, or pick one from Examples to start from the RFC's bookstore.
- 2Paste your JSON below it.
- 3Read the matches on the right, each with its full path, such as $['store']['book'][2].
- 4Copy the matched values as a JSON array.
Troubleshooting
- Quote names inside brackets
- Inside [ ], property names are strings:
$['first name'], not$[first name]. Outside brackets,$.nameworks for plain names. - No matches
- The path is valid but points at nothing. Shorten it from the end until something matches, then add the parts back one at a time.
- A filter compares nothing
- Filters test array items or object members, so put them in brackets after the array:
$.books[?@.price < 10], not$.books.price[?…].
Frequently asked questions
Is my JSON uploaded?
No. The path runs in your browser.
What's the difference between JSONPath and JMESPath?
They're different languages for the same job. JSONPath returns the matching values, with paths; JMESPath, used by the AWS CLI, can also reshape the result.
Can API tests check values with JSONPath?
Yes: API tests on testingapis.com check response values at JSONPath locations and can pass a value from one response into the next request.