How to use it
- Paste JSON on the left, or click Sample to load the classic bookstore document.
- Type an expression in the Path box. Results update as you type.
- Switch Return between Values (the matched data) and Paths (the location of each match).
The output is always a JSON array of matches, and the status bar shows how many were found. Expressions must start with $. Invalid expressions show the parser’s message, e.g. Expected expression after < at character 12.
Syntax cheat sheet
| Expression | Selects |
|---|---|
$ |
The root document |
.key or ['key'] |
A child property (use brackets for keys with spaces or dashes) |
..key |
key at any depth (recursive descent) |
* |
Every child of an object or array |
[n] |
Array element n, starting at 0 |
[start:end] |
A slice; end is exclusive, negative numbers count from the end |
[?(expr)] |
Elements where the filter expression is true |
@ |
The current element inside a filter |
Examples against the sample data
| Path | Result |
|---|---|
$.store.book[2].author |
["Herman Melville"] |
$..author |
All four authors |
$.store..price |
[8.95, 12.99, 8.99, 22.99, 19.95] — books and the bicycle |
$.store.book[0:2].title |
["Sayings of the Century", "Sword of Honour"] |
$.store.book[-1:].title |
["The Lord of the Rings"] |
$.store.book[?(@.isbn)].title |
Books that have an ISBN: ["Moby Dick", "The Lord of the Rings"] |
$.store.book[?(@.price < 10)].title |
["Sayings of the Century", "Moby Dick"] |
$.store.book[?(@.category == 'fiction' && @.price < 15)].title |
["Sword of Honour", "Moby Dick"] |
With Return: Paths, $..author gives $['store']['book'][0]['author'] through [3].
JSONPath vs jq
The same query in both:
# JSONPath
$.store.book[?(@.price < 10)].title
# jq
jq '.store.book[] | select(.price < 10) | .title' store.json
JSONPath is declarative and read-only, which is why it shows up in Kubernetes (kubectl -o jsonpath), AWS Step Functions, Amazon API Gateway mapping templates and JMeter’s JSON Extractor. jq is the better choice when you need to reshape the output.
A note on RFC 9535
JSONPath was standardized as RFC 9535 in 2024. The standard is close to the classic syntax, but differs in details: filters are written [?@.price < 10] without parentheses, and functions such as length() and match() are defined. This tester follows the classic syntax but also accepts the RFC form: [?@.price < 10] is automatically read as [?(@.price < 10)]. RFC functions like length() are not supported; using one shows a message suggesting an equivalent filter such as [?(@.tags.length > 1)]. Check which dialect your target library implements before copying expressions between tools.
Finding the right path
Not sure where a value lives? Open the document in the JSON Viewer, click the node you want, and copy its JSONPath from the bar at the bottom. Paste it here and generalize it with wildcards or filters — for example, turn $.store.book[2].price into $.store.book[*].price or $.store.book[?(@.price > 10)].title.
Need to understand the structure first? Pretty-print it with the JSON Formatter, or generate a JSON Schema to see every field and type.
Frequently asked questions
Which JSONPath dialect does this tester use?
It uses jsonpath-plus, which implements the widely used Goessner syntax with filter expressions written as [?(...)]. RFC 9535-style filters without parentheses, such as [?@.price < 10], are accepted too. Filters run in a safe expression evaluator, not JavaScript eval.
What is the difference between Values and Paths?
Values returns the matched data. Paths returns where each match lives, in normalized bracket form such as $['store']['book'][0]['author'] — handy when you need to update or delete those nodes in code.
Why do I get an empty array?
The expression is valid but matched nothing. Check key spelling and case, and remember array indexes start at 0. The status bar shows "0 matches".
How is JSONPath different from jq?
JSONPath only selects nodes from a document. jq is a full language that can also transform, reshape and compute new values. Use JSONPath for queries in config, tests and APIs; use jq in shell pipelines.
Is my JSON uploaded?
No. Queries run entirely in your browser — nothing is uploaded.
Last updated