JSONPath Tester Online
Write JSONPath expressions and instantly query JSON data in your browser.
When a JSONPath tester is the right tool
A JSON payload is often larger than the few fields you care about. This page is for extracting those values in the browser: paste JSON, write a path that starts with $, and see every match in a pretty-printed array. The result updates as you type, and you can copy it.
The evaluator is intentionally small. It is a good fit for walking objects and arrays. It is the wrong tool for filter expressions. If the paste is not valid JSON, tidy it with the JSON Formatter first.
Use cases
Picking a column out of an array
$.store.books[*].title returns every title in the sample catalog. The “All book titles” and “First book” chips set that path and $.store.books[0] for you. A negative index such as [-1] counts from the end.
Finding a field no matter how deep it is
$..price walks the whole document and collects every price, including the bicycle in the sample as well as the books. A recursive query can return more values than a single object path.
Reading a nested key with dots or unusual characters
Dot children work for ordinary names. Bracket notation ['bicycle'] or ["bicycle"] is available when you prefer it, or when a key would be awkward as a dot path. $ by itself returns the whole document as a one-element array.
How queries work
The JSON is parsed, the path is tokenized, and the evaluator walks those tokens.* after a dot visits object values or array elements; [*] visits array elements only. Missing paths and out-of-range indexes contribute nothing. The output is JSON.stringify of the match list, with the match count in the results header.
$.store.books[*].title
[
"Sayings of the Century",
"Sword of Honour",
"Moby Dick",
"The Lord of the Rings"
]The wildcard steps through the array, then each title is collected. That is the default path when you first open the page.
$..price
[
8.95,
12.99,
8.99,
22.99,
19.95
]The last value, 19.95, is the bicycle, not a fifth book.
What this tool does not do
It does not evaluate filters, slices, or unions, and it does not follow JSON pointers. An unsupported expression usually looks like zero matches. Nothing is sent to a server. To flatten the document instead of querying it, use the JSON Flattener.
How to use JSONPath Tester
- Paste JSON, or use Load Sample to restore the bookstore document (it is already there when you first open the page).
- Enter a path starting with
$, or click one of the example chips. - Read the match list as it updates, then copy it if you need the JSON array.
Frequently asked questions
Which JSONPath features are supported?
This is a small built-in evaluator, not a full JSONPath library. It supports a leading $, dot children, recursive descent (..), numeric indexes including negatives ([0], [-1]), the wildcards [*] and *, and bracket keys such as ['title'] or ["title"]. The path must start with $. Results are always a JSON array.
Can I use filters, slices, or unions?
No. Expressions such as $[?(@.price<10)], $[0:2], or $[0,1] are not implemented. They typically return an empty array rather than a syntax error, which can look like “no matches.” If you need filters, use a JSONPath library or a script.
When does the query run?
It runs in the browser as you type, whenever both the JSON and the path are non-empty. The page opens with a bookstore sample and $.store.books[*].title already filled in. Four chips under the path field set common expressions on that sample without changing the JSON.
What do the error messages mean?
If the path does not start with $, you get “Path must start with $.” If the JSON cannot be parsed, a short Invalid JSON message is shown (check syntax when the input is long). A valid path that matches nothing returns [] and a match count of 0, which is not treated as an error.
Is my JSON sent to a server?
No. Parsing and queries run in your browser as you type. Closing the tab discards what you pasted. Do not paste documents that contain secrets if you would not be comfortable with them sitting in memory on this device.
Is there a file size limit?
There is no server-imposed limit, because nothing is uploaded. Typical API payloads are comfortable. A very large document or a broad recursive query can make the tab feel slow; in that case, query a smaller excerpt.