ToolJutsu
All tools
Developer Tools

JSONPath Tester

Test JSONPath queries against a JSON document.

0 chars
Example expressions (for the sample document)
Processed on your device. We never see your files.

How to use JSONPath Tester

What this tool does

JSONPath is a query language for JSON. Instead of writing loops to dig through a nested object, you write a short expression that describes the values you want, and the engine returns them. This tester lets you do that interactively: paste a JSON document, type a JSONPath expression, and immediately see what it selects. It reports the match count, the matched values as pretty-printed JSON, and the matched paths — the precise location of each result inside the document. Both invalid JSON and invalid expressions produce a clear error rather than a silent failure. Everything runs inside your browser.

Why you might need it

JSONPath turns up in many places — API gateways, CI tooling, log processors, configuration systems, and libraries in every major language. Writing an expression and getting it wrong is easy, and a wrong expression is hard to debug once it is buried in a pipeline. A tester gives you a tight feedback loop: try the expression here against a real sample of your data, confirm it returns exactly what you expect, and only then paste it into your code or config. It is also a fast way to learn the syntax — change one character, watch the results change, and build an intuition for how wildcards, recursive descent and filters behave.

How to use it

  1. Paste a JSON document into the document box, or drop a .json file onto it. Click Load sample to start from an example.
  2. Type a JSONPath expression into the expression field, or click one of the example buttons to fill it in.
  3. The results update as you type: a match count, the matched values as JSON, and the list of matched paths.
  4. Copy the matched values with one click when the expression does what you want.

Syntax explained

Every expression starts at the root, written $. From there you step into the data. Dot notation $.store.name and bracket notation $['store']['name'] both access a child. A wildcard * matches every element or property at that level, so $.store.books[*] is every book. Recursive descent .. searches at any depth: $..price finds every price anywhere in the document. Arrays accept an index like [0], a negative index like [-1] for the last element, and a slice like [0:2] for a range. Filter expressions are the most powerful piece: $.store.books[?(@.price < 30)] keeps only the books whose price is below 30, where @ refers to the element currently being tested.

Common pitfalls

The difference between “no match” and “error” matters. A syntax error means the expression itself is malformed and the tool shows a red error. A valid expression that simply finds nothing is reported separately — that almost always means a typo in a key name, the wrong nesting depth, or a filter condition that is never true for your data. Another common surprise is that JSONPath always returns a list, even when only one item matches; a single result is still wrapped as a one-element array. Finally, remember that filter syntax can vary slightly between JSONPath implementations — an expression that works here may need a small tweak in a different library, so test against the engine you will actually deploy with.

Tips and advanced use

When an expression is not behaving, build it up one segment at a time: start with $, confirm it returns the whole document, then add one step and watch the results narrow. Use the matched-paths output when you need to know where a value lives — it gives you a normalized, copy-pasteable path to each result. Because the whole tester runs locally, it is completely safe to paste in JSON that contains tokens, internal identifiers or customer data; none of it ever leaves your device.

Frequently asked questions

Is my JSON document sent anywhere?
No. The document and the JSONPath expression are evaluated entirely in your browser. Nothing is uploaded — you can disconnect from the network and the tester still works exactly the same.
What is JSONPath?
JSONPath is a query language for JSON, similar in spirit to what XPath is for XML. An expression like $.store.books[*].title walks into a document and pulls out the values you want, instead of you writing code to traverse it by hand.
What syntax does this tester support?
It uses the jsonpath-plus library, which supports the common JSONPath syntax: the root $, child access with dot or bracket notation, wildcards (*), recursive descent (..), array slices ([0:2]), and filter expressions such as [?(@.price < 30)].
Why does my expression match nothing?
A valid expression that matches nothing usually means the path does not exist in this particular document — a misspelled key, the wrong nesting level, or a filter whose condition is never true. The tool tells you the expression is valid but empty so you can distinguish that from a syntax error.
What is the difference between the values and the paths output?
The matched values are the actual data your expression selected. The matched paths are the normalized locations of those values inside the document, like $['store']['books'][0]['title']. Paths are useful when you need to know where a value came from, not just what it is.

Related tools