Skip to content
Devtoolry

JSONPath Tester

Test JSONPath expressions online against your JSON with live results. Supports filters, wildcards, recursive descent, slices and unions, and shows the path of every match.

Runs in your browser · Nothing uploaded · No sign-up

Something not working, or missing a feature? Send feedback

About the JSONPath Tester

The JSONPath Tester evaluates a JSONPath expression against your JSON as you type and lists every match with its full path. It supports filters like [?(@.price < 10)], wildcards, recursive descent (..), slices, unions and regular expressions, and it points to the exact position of a mistake in the expression.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the JSONPath Tester

  1. Paste or open the JSON document in the left editor.
  2. Type a JSONPath expression starting with $, or click one of the examples.
  3. Read the matches on the right, each with its normalised path, and copy the values as a JSON array.

Examples

Filter books cheaper than 10

Input

$.store.book[?(@.price < 10)].title

Result

[
  "Sayings of the Century",
  "Moby Dick"
]

Run against the sample document. Each match is also listed with its path, such as $['store']['book'][0]['title'].

Find every price at any depth

Input

$..price

Result

[
  8.95,
  12.99,
  8.99,
  22.99,
  399
]

The .. operator searches the whole document, so the bicycle price is found as well as the book prices.

Common mistakes

  • Forgetting the $. Every expression starts at the root with $. store.book fails; $.store.book works.
  • Filtering the wrong level. [?(...)] tests the children of the node it follows. To filter books, put it after book, not after store.
  • Expecting one value. JSONPath always returns a list of matches, even for a single result. Use the first match when you only expect one, and handle an empty list when nothing is found.
  • Library differences. Implementations differ on filter details and on results for missing keys. Use this tool to check the logic, then test with the library you ship.

Works well with the JSONPath Tester

Frequently asked questions

Which JSONPath syntax is supported?

The common core of RFC 9535 and the original Goessner syntax: $, .name, ['name'], [0], [-1], [*], .., unions like [0,2], slices like [1:4:2], and filters with ==, !=, <, <=, >, >=, !, && and ||. A =~ /regex/ match is supported as an extension.

Why does my filter return nothing?

Filters apply to the children of the node before them, so write $.store.book[?(@.price < 10)], not $.store[?(@.price < 10)]. Also compare like with like: the string "10" is not less than the number 20.

Does it run my expression with eval?

No. The expression is parsed by a small interpreter in the page, so nothing from your JSON or your expression is ever executed as code, and nothing is uploaded.

What does the path next to each match mean?

It is the normalised path of that value, with every step in brackets. It identifies the match uniquely, so you can reuse it as a plain path in code or compare it with a result from another tool.