JSONPath Tester
Test JSONPath expressions against JSON data with live results.
Example paths
What is JSONPath?
JSONPath is a query language for JSON, in the same spirit as XPath for XML. It lets you navigate a JSON document with a short path expression and pull out exactly the values you want, without writing a program to walk the tree yourself. A path starts at the root ($) and then chains steps such as a property name, an array index, or a wildcard.
JSONPath is widely used in tooling: API test suites, log processors, configuration linters, and services such as Kubernetes and many monitoring tools accept JSONPath to select fields from structured data. Learning the handful of core operators covers the vast majority of real queries.
This tester evaluates an expression against the JSON you paste and shows every match, together with a result count and how long the evaluation took. Editing either the JSON or the expression re-runs the query automatically.
How evaluation works
- Start — the whole document is the initial match at
$. - Apply each step — every operator transforms the current set of matches into a new set. A wildcard can turn one match into many.
- Collect — once the path is exhausted, the remaining values are returned as the results.
- Recursive descent —
..searches every level of the document before the next operator is applied.
This tester implements the core operators listed below. Extended features such as slices and general filter predicates are not fully implemented, so a path that relies on them may not behave as a full JSONPath engine would.
| Operator | Description |
|---|---|
| $ | Root object |
| .key | Child by key |
| ['key'] | Child by key (bracket notation) |
| [n] | Array index (0-based) |
| [*] | Wildcard (all children) |
| .. | Deep scan (recursive descent) |
How to Use
- Paste the JSON — Paste a document into the left panel, or click Example JSON for a sample.
- Enter a path — Type an expression such as
$.store.book[*].title, or pick an example chip. - Read the results — Matches appear with an index, a result count, and the evaluation time.
- Iterate — Change the JSON or the expression and the query re-runs automatically.
If a path finds nothing, the panel reports "No matches found" rather than an error. Malformed JSON is reported separately with the parser's message.
Worked example
Given this document:
{
"store": {
"book": [
{ "title": "Sayings of the Century", "price": 8.95 },
{ "title": "Moby Dick", "price": 8.99, "isbn": "0-553-21311-3" }
],
"bicycle": { "color": "red", "price": 19.95 }
}
}
The expression $.store.book[*].title returns the titles of every book, because [*] expands the array and .title selects the title from each element:
[0] "Sayings of the Century"
[1] "Moby Dick"
Swapping in $..price uses recursive descent to collect every price anywhere in the document, and $.store.* returns both children of store: the book array and the bicycle object.
Frequently Asked Questions
What is the difference between JSONPath and JMESPath?
JSONPath is inspired by XPath and uses a similar syntax with $ as the root and dots for child access. JMESPath is a separate specification, commonly used by the AWS CLI, with its own syntax. The two are not interchangeable, though they solve similar problems.
Is my JSON data stored on a server?
No. All processing happens entirely in your browser using JavaScript. Your JSON data never leaves your device.
Does this support JSONPath filter expressions?
The tester implements the core operators — root, child access, bracket access, array index, wildcard, and recursive descent. Slices and general filter predicates are not fully implemented, so paths that depend on them may not behave exactly like a complete JSONPath engine.
Which operators are supported?
Root ($), dot child (.key), bracket child (['key'] or ["key"]), array index ([n]), wildcard ([*] or .*), and recursive descent (..). These cover the overwhelming majority of practical queries.
What does recursive descent do?
The .. operator searches every level of the document rather than just the current one. The expression $..price collects every price field anywhere in the JSON, then the operator that follows .. is applied on top of those matches.
Why does my expression return no results?
Common causes are a typo in a key name, applying an array index to an object, or a path that relies on an unsupported feature such as a slice. Check that the key exists and that each step matches the shape of the value at that point.
Does it validate my JSON?
It parses the JSON before evaluating, so malformed JSON is reported with a parser error and no path is run. For deeper validation, including schema checks, use a dedicated JSON validator.
How is the result count calculated?
Each value that the fully traced path resolves to is one result. A wildcard or recursive descent can produce many results from a single expression, and each is numbered in the output.
Related JSON Tools
JSON Formatter
Format and validate JSON
JSON Validator
Validate and repair JSON
JSON Schema Validator
Validate JSON against schema
JSON Viewer
Explore JSON with tree view
JSON Schema Generator
Generate schema from JSON
JSON to Table
Convert JSON to HTML table