About the JSONPath Tester
Write a JSONPath expression such as $.store.book[?(@.price < 10)].title and see the matching values instantly.
Key features
- Evaluate JSONPath expressions live as you type
- Filters, wildcards, slices and recursive descent
- Results always returned as an array
- Built-in sample store document to experiment with
- Powered by the widely used jsonpath-plus engine
- Runs in your browser
What is JSONPath?
JSONPath is a compact query language for selecting values from JSON. Instead of writing loops to dig through nested data, you write one expression like $.orders[*].total and get every matching value. It's used in API testing tools (Postman, REST Assured), Kubernetes (kubectl -o jsonpath), AWS Step Functions, monitoring tools and many SDKs.
Syntax cheat sheet
| Expression | Meaning |
|---|---|
$ | The root |
$.store.bicycle.color | Child by name |
$['store']['bicycle'] | Bracket notation (for keys with spaces) |
$.store.book[0] | First array element |
$.store.book[-1:] | Last element |
$.store.book[0:2] | Elements 0 and 1 (slice) |
$.store.book[*].title | All titles |
$..price | Every price, at any depth |
$.store.* | All children of store |
$.store.book[?(@.price < 10)] | Books cheaper than 10 |
$.store.book[?(@.isbn)] | Books that have an isbn |
Example
With this data:
{ "store": { "book": [
{ "title": "Sayings", "price": 8.95 },
{ "title": "Moby Dick", "price": 8.99 },
{ "title": "The Lord of the Rings", "price": 22.99 }
] } }
$.store.book[?(@.price < 10)].title returns:
["Sayings", "Moby Dick"]
Where you'll use JSONPath
- Postman and API tests: assert on response values.
- Kubernetes:
kubectl get pods -o jsonpath='{.items[*].metadata.name}'. - AWS Step Functions:
InputPath,ResultPathandOutputPath. - Alerting and dashboards: extracting metrics from JSON payloads.
- Data pipelines: selecting fields before loading.
Tips
- Start broad (
$..*) and narrow down. - Use
$..keywhen you don't know the depth. - Quote keys with special characters:
$['first-name'].
Related tools
Find paths by clicking in the JSON Viewer or JSON Navigator, both of which copy JSONPath expressions.
How to use the JSONPath Tester
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The result appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.