Overview
Test JSONPath expressions against any JSON
JSONPath is a query language for JSON, the same idea as XPath for XML. You write a short expression that describes which parts of a document you want, and the engine walks the JSON and returns every matching value. It is the quickest way to pull a deeply nested field, collect every item in an array, or filter objects by a condition without writing a loop.
ToolHub JSONPath Tester evaluates your expression live against the JSON you paste, shows the matched values as pretty-printed JSON, and counts how many matches it found. Everything happens in your browser.
Step-by-step
How to use the JSONPath tester
- 1
Paste your JSON
Drop any JSON document into the left panel. The tool parses it instantly and flags syntax errors so you can fix them. - 2
Write an expression
Type a JSONPath in the expression box, or click one of the example chips to load a ready-made query. - 3
Read the matches
Matched values appear on the right as formatted JSON, with a live match count. Copy the result with one click.
Background
JSONPath syntax in a nutshell
Every expression starts at the root, written as $. From there you step into the document with dot or bracket notation and optionally filter what you collect.
The building blocks
- $ is the root of the document.
- . (dot) or [ '...' ] selects a child by name, for example $.store.book.
- * is a wildcard that matches every key or array element.
- .. is a recursive descent that searches at any depth, for example $..price.
- [n] selects an array element by index, and [start:end] selects a slice.
- [?(@.price < 10)] is a filter that keeps only items matching a condition.
Filters and the current node
Inside a filter the @ symbol refers to the element being tested. So $..book[?(@.isbn)] keeps books that have an ISBN, and $..book[?(@.price < 10)] keeps books under ten. Filters are where JSONPath becomes genuinely powerful.
Use cases
Where JSONPath is handy
Exploring API responses
Paste a response and pull out just the fields you care about before writing any code.
Configuring tools
Many tools (Postman, Splunk, Kubernetes, n8n) accept JSONPath to extract values from JSON.
Filtering arrays
Grab only the records that match a price, status, or flag without a manual loop.
Data validation
Check whether an expected field exists anywhere in a nested payload.
Building selectors
Draft and verify the exact expression you will paste into your code or pipeline.
Learning the syntax
Experiment with wildcards, slices, and filters and see results update instantly.
Tips for writing expressions
- Start broad with $.* or $..* to see the shape of the data, then narrow down.
- Use recursive descent $..field when you do not know the exact depth of a value.
- Remember array indexes are zero-based, so the first book is [0].
- Filter expressions must be wrapped in [?(...)] and use @ for the current item.
- If you get zero matches, check key spelling and that the path matches the actual nesting.
Common questions
What is the difference between JSONPath and XPath?
They share the same goal, querying a tree, but JSONPath targets JSON while XPath targets XML. The notation differs: JSONPath uses $, dots, and bracketed filters, while XPath uses slashes and predicates.
Why does my result always come back as an array?
JSONPath can match many nodes, so results are returned as a list even when there is a single match. A query that matches one value gives an array of length one.
Are there different JSONPath dialects?
Yes. Implementations differ slightly on filters, script expressions, and edge cases. This tool uses the widely adopted jsonpath-plus engine, which closely follows the original Goessner specification.
Can it modify the JSON?
No. JSONPath is read only here. It selects and returns values without changing your source document.
100% private