Skip to content

JSONPath Tester

Runs a JSONPath query against your JSON and shows every match with the exact path it came from.

Your JSON stays on this device

This tool runs entirely inside your web browser. Your JSON is processed on your own device and is never sent to our servers. How this works

Examples you can click

0 matches

Paste some JSON to see the matches.

JSONPath Tester lets you try a JSONPath query against your own JSON and see exactly what it matches. Every result is shown with the path it came from, so you can tell which item in an array a value belongs to. It runs in your browser, so you can paste a real API response.

How to test a JSONPath query

  1. Paste your JSON, or click Example for a sample document.
  2. Type a query, or pick one from Examples you can click.
  3. Matches appear as you type, each with its full path.

The syntax, briefly

Write thisTo get
$The whole document
$.store.nameOne property, step by step
$.book[0]The first item; arrays start at 0
$.book[-1:]The last item
$.book[0:2]A slice: the first two
$.book[*].titleOne field from every item
$..priceEvery price at any depth
$.book[?(@.price < 10)]Only the cheap ones; @ is the item being tested
$..book[?(@.isbn)]Items that have a field at all

When a query returns nothing

Usually the path does not match the shape of the data. Build it up one step at a time: start with$, confirm it matches the whole document, then add $.store, then$.store.book, and so on. The step where the matches disappear is the step that is wrong. A common trip-up is expecting an object where the data actually has an array.

Filters

A filter like [?(@.price < 10)] keeps only the items where the test passes. Comparisons (<, >, ===) and existence checks (@.isbn) both work. Arbitrary JavaScript inside a filter does not, because this page does not allow code to be built and run at runtime, which is also what keeps a pasted document safe.

Related tools

To make a response readable first, use the JSON Formatter. To check a document against a set of rules rather than pull values out of it, use theJSON Schema Validator, and to generate types from an example, useJSON to TypeScript.

Frequently asked questions

What is JSONPath?

A small query language for JSON, in the spirit of CSS selectors for HTML. A path like $.store.book[0].title picks out one value, and $..price finds every price at any depth.

What do $, .. and * mean?

$ is the whole document, a dot steps into a property, .. searches at any depth below, and * matches every child. So $..book[*].title is every book title anywhere in the document.

Can I filter on a value?

Yes. $.store.book[?(@.price < 10)] returns the books under 10, where @ means "the item being tested". Comparisons and existence checks work; running arbitrary JavaScript does not, because this page forbids it.

Why does my query return nothing?

Usually the path does not match the shape of the data. Start from $ and add one step at a time, checking the matches as you go. Remember arrays are numbered from 0.

Is my JSON uploaded?

No. The query runs in your browser, so you can safely paste a real API response.

Last updated

Missing a feature, or need a tool we don’t have? Suggest it.