JSON Path Tester - Test JSONPath Expressions Online
Developer Tools
Test JSONPath expressions against a JSON document in real time. Supports wildcards, recursive descent, unions, stepped slices, and boolean filters.
Classic JSONPath subset, with no eval. This is not a full RFC 9535 engine; functions, nested filters, and parenthesized filter expressions are not supported.
Results
3 matches3 matches found.
$.store.book[0].title"Atlas"
$.store.book[1].title"Moby Dick"
$.store.book[2].title"Sword"
How to use this tool
- Add a JSON document. Edit the sample in the JSON Document box or paste your own JSON. Use Format to indent valid JSON, Minify to compact it, or Reset sample to restore the bookstore example and its default query.
- Choose or write a JSONPath expression. Click an example chip or enter an expression starting with $. Use dot or quoted bracket keys for properties, [*] for children, and ..key to find a property recursively.
- Narrow results with filters and slices. Use a filter such as [?(@.price > 10 && @.category == "fiction")] to check array items. Use [start:end:step] to select array positions; the end is exclusive.
- Inspect and copy matches. Each result shows the JSONPath to a match and its formatted value. Copy values to get a JSON array of selected values, or Copy paths to copy one matching path per line.
What is JSONPath?
JSONPath is a query language for JSON, analogous to XPath for XML. It lets you extract specific values from a JSON document using a concise path expression. Defined by Stefan Goessner in 2007 and widely used in tools like Kubernetes, AWS Step Functions, and Gatling.
Supported syntax
| Expression | Meaning |
|---|---|
$ | Root element |
.key | Child key |
['key'] | Bracket child (useful for keys with dots) |
[n] | Array index (negative counts from end) |
[*] | All children (wildcard) |
[0:2] | Array slice; end position is exclusive |
[-2:] | Slice from the second-to-last item to the end |
[0:4:2] | Slice with a step; selects indexes 0 and 2 |
[0,2] | Array index union |
['title','author'] | Quoted object member union |
..key | Recursive descent: find key anywhere |
[?(@.price > 10)] | Filter expression |
Filter operators
Filter expressions use @ to refer to the current element. Supported comparisons:
==, !=, >,
<, >=, <=. Combine simple checks with
&& and ||; && is evaluated first. Parenthesized
groups and nested filters are outside this tester's supported subset.
JSONPath vs. JMESPath
| Feature | JSONPath | JMESPath |
|---|---|---|
| Origin | Stefan Goessner, 2007 | Amazon Web Services, 2013 |
| Standardization | RFC 9535 (2024) language standard | RFC 9901 (draft) |
| Recursive descent | ..key | Not supported |
| Filter syntax | [?(@.age > 18)] | [?age > \`18\`] |
| Used in | Kubernetes, Gatling, Newtonsoft.Json | AWS CLI, Terraform, Ansible |
RFC 9535 standardizes JSONPath as a language, but this interactive evaluator implements a
smaller Classic subset. It deliberately avoids dynamic code evaluation. It supports the syntax
listed above, but does not implement RFC functions such as length() or
count(), nested filter queries, or parenthesized filter groups.
Real API examples
JSONPath is useful when inspecting API payloads, selecting fields for a test fixture, or checking a response before transforming it. These expressions show common queries against REST API responses:
$.data[*].id- extract all IDs from a paginated list$.items[?(@.status == "active")].name- filter active items by name-
$..href- recursively find allhrefvalues in a HAL response $.meta.pagination.total- drill into nested metadata
How matches are calculated
Evaluation starts at the root value represented by $. Each path step narrows the
current set of values: a key step chooses a property, a wildcard visits each child, and a
filter keeps array elements whose simple condition is true. The result panel reports one
matching value per selected node and shows the path used to reach it. For example,
$.store.book[0:3:2].title selects the titles at indexes 0 and 2; slice end positions
are exclusive, and a negative bound counts back from the array's end.
An empty result is different from invalid JSON: it can mean that the document parsed correctly
but no node satisfied the query. Check spelling and capitalization, verify whether a property
is nested under an array item, and use @ for the item inside a filter. This tester
supports common Classic expressions rather than every JSONPath dialect, so an unsupported extension
may also produce no matches. Use the syntax table and the dialect note above when comparing results
with another engine.
Frequently asked questions
Which JSONPath features does this tester support?
It supports root paths, dot and quoted bracket keys, wildcards, recursive descent, array indexes and unions, slices with optional steps, and simple filters with comparisons, &&, and ||. It is a Classic subset, not a full RFC 9535 implementation: functions, nested filters, and parenthesized filter expressions are not supported.
What is the difference between $ and @ in a filter?
The dollar sign refers to the root JSON value. Inside a filter, @ refers to the current array item being checked. For example, $.store.book[?(@.price > 10)] starts at the store, visits its books, and keeps books whose price is above 10.
How do && and || combine conditions?
The tester evaluates && before ||. In [?(@.price > 10 && @.category == "fiction" || @.category == "reference")], a reference book can match on its own, while a fiction book must also cost more than 10. Parenthesized grouping is not supported.
Are JSONPath slice end positions inclusive?
No. The end position is exclusive, like a JavaScript array slice. For example, $.store.book[0:2] selects indexes 0 and 1. A third number sets the step, and negative bounds count from the end of the array.
Why did a query return no matches?
A query can be valid and still select nothing. Check property names, capitalization, quotes, and array indexes, then compare the expression with the supported subset above. Some unsupported JSONPath syntax currently produces no matches instead of a specific syntax error.
Does the tester upload the JSON I enter?
No. The JSON and expression are parsed and evaluated in this browser. This page does not provide file upload or remote URL fetching, and it does not send the entered data to a server.
Related tools
- JSON FormatterUse JSON Formatter to format, validate, and minify JSON instantly in your.
- JSON Schema ValidatorUse JSON Schema Validator to validate any JSON document against a JSON Schema.
- JSON Diff ViewerUse JSON Diff Viewer to compare two JSON objects side-by-side. Instantly see added,.
- JSON -> TSUse JSON -> TS to paste JSON and instantly generate TypeScript interfaces with.