JSONPath Tester
Test JSONPath expressions online and find any nested value in a JSON object. See every match with its exact path, with filters and wildcards. Free and private.
Find any nested value with JSONPath
JSONPath is a query language for JSON, much as XPath is for XML. Instead of scrolling through a large response, you write a short expression and get back every value it matches. This tester evaluates your expression as you type and shows both the matched values and the exact path to each one, so you can build a query before pasting it into code.
Filters are evaluated in a safe mode that does not run arbitrary JavaScript, so an expression pasted from elsewhere cannot execute code in this page.
JSONPath syntax cheat sheet
$is the root of the document..nameor['name']selects a child. Use the bracket form for keys with spaces or dashes...pricesearches at any depth for keys namedprice.[*]selects every item, and[0]selects the first.[-1:]selects the last item, and[0:2]selects the first two.[?(@.price < 10)]filters items by a condition, where@means the current item.
Example queries
Using a small bookstore document, these expressions return different views of the same data. Press the example buttons above the editor to try them on the built-in sample.
{ "store": { "book": [
{ "title": "Sayings", "price": 8.95 },
{ "title": "Sword", "price": 12.99 }
] } }
$.store.book[*].title ["Sayings", "Sword"]
$..price [8.95, 12.99]
$..book[?(@.price < 10)] [{ "title": "Sayings", "price": 8.95 }]Where JSONPath is used
You will meet JSONPath in API testing tools such as Postman, in kubectl output templates, in AWS Step Functions and in monitoring systems that pull values out of a response. Implementations differ in the details, especially filters and how results are wrapped. This page uses the jsonpath-plus library, so test important expressions again in the environment where they will run. RFC 9535 now standardises the core syntax, which should reduce these differences over time.
Frequently Asked Questions
Why do I get an empty result?
Check the case of the key names, because JSONPath is case-sensitive. Also confirm whether the value sits inside an array, which needs [*] or an index on the way to it.
What is the difference between . and ..?
A single dot selects a direct child. A double dot searches the whole subtree, so $..id finds every id at any depth.
How do I select a key that has a dash?
Use bracket notation with quotes, such as $['content-type']. The dot form only works with simple names.
Why does the result always come back as an array?
An expression can match any number of values, so results are returned as a list. The Matched paths table shows where each one came from.