How to test a JSONPath expression
- Paste your JSON on the left. A sample bookstore document is loaded so you can experiment straight away.
- Type a JSONPath expression. Results update as you type and are shown as a JSON array, with the exact paths of the first matches in the status line.
- Click an example to see common patterns, then adapt them to your data.
JSONPath syntax
$is the root;.nameor['name']selects a child;[0]an array item and[-1]the last one.*selects all children, and..namesearches recursively at any depth.[0,2]picks several items, and[1:3]or[-2:]slices arrays, as in Python.[?(@.price < 10)]filters items:@is the current item. Combine conditions with&&and||, and use[?(@.isbn)]to test that a field exists.
JSONPath is used in many tools: Kubernetes kubectl -o jsonpath, AWS Step Functions, Postman and REST Assured tests, Grafana and Zapier data mapping, and libraries such as Jayway JsonPath and jsonpath-ng. This tester follows the widely used Goessner syntax, which RFC 9535 standardised in 2024. Implementations differ slightly in filter syntax, so check edge cases in your target tool.
Privacy
Queries run locally in your browser, and your JSON is never uploaded.
What is the difference between JSONPath and jq?
Both query JSON. JSONPath is a path language for selecting values and is built into many tools. jq is a full command-line language that can also transform and reshape data.
How do I select a key with a dot or space in its name?
Use bracket notation with quotes, for example $['first name'] or $.data['user.id'].
Why does my filter return nothing?
Filters apply to the children of the selected node. Use $.items[?(@.active)] on an array, not $.items.active. Also check types: "10" is a string, not the number 10.