JSON Path Tester
Test JSONPath expressions against JSON data instantly. Evaluate, debug, and validate JSONPath queries with live results and error highlighting.
Updated
What is the JSON Path Tester?
JSONPath is a query language for JSON, similar to how XPath works for XML. It allows you to navigate and extract specific parts of a JSON document using a concise, intuitive syntax. Whether you're debugging an API response, validating a data structure, or simply trying to understand a deeply nested object, JSONPath gives you precise control over what you retrieve.
Our JSONPath Tester lets you write and evaluate JSONPath expressions instantly, directly in your browser. No server round‑trips, no data collection — just fast, private, and hassle‑free testing.
Key features at a glance:
- Live evaluation as you type — see results and match counts immediately.
- JSON validation with line‑level error highlighting, so you never lose time on a misplaced comma.
- Recursive descent, wildcards, slices, unions, and property/index access — all in a lightweight engine.
- Sample data and a hand‑picked examples dropdown to get you started in one click.
- Copy results to your clipboard with a single button.
- Zero ads, zero tracking — the tool runs entirely client‑side.
If you work with JSON regularly, this tester saves you the trouble of opening a console or writing throwaway scripts every time you need to verify a path.
How it works
The JSONPath Tester combines a hand‑written JSONPath parser and evaluator with a live‑editing interface. Every change triggers a fresh computation, giving you instant feedback.
1. Input your JSON
Paste or type any valid JSON into the left editor. If the JSON is malformed, an error message appears immediately, and the offending line number is highlighted in the gutter.
2. Write a JSONPath expression
Enter an expression like $.store.book[0].title in the dedicated field. You can also pick from the examples dropdown — it covers common patterns such as wildcards, slices, and recursive descent.
3. See the results
As soon as both JSON and path are valid, the tool:
- Parses the JSONPath string into a sequence of selectors (property, index, wildcard, slice, union, recursive descent).
- Walks the JSON tree, applying each selector step by step.
- Collects every matching value into an array.
The number of matches appears in a prominent stat card, and the results are displayed in a read‑only editor (formatted with indentation for readability). If no values match, a gentle hint suggests trying a different expression.
Supported syntax
| Syntax | Example | Meaning |
|---|---|---|
| Dot notation | $.store.book |
Child key access |
| Bracket notation | $['store']['book'] |
Same, with special characters allowed |
| Array index | $.store.book[0] |
First element of the book array |
| Negative index | $.store.book[-1] |
Last element |
| Wildcard | $.store.book[*] |
All elements of the array |
| Recursive descent | $..author |
All author values anywhere in the document |
| Slice | $.store.book[0:2] |
Elements from index 0 up to (but not including) 2 |
| Slice with step | $.store.book[0:4:2] |
Every second element in the range |
| Union | $.store.book[0,2] |
Elements at indices 0 and 2 |
| Object wildcard | $.store.book[0].* |
All values inside the first book |
Under the hood
The evaluator is pure TypeScript with no external JSONPath libraries. It parses the expression in a single pass, builds an internal selector list, and then traverses the JSON structure recursively. This keeps the tool fast, small, and free of dependency‑related quirks.
All processing happens inside your browser — your data never leaves your device.
Examples
Extract all book authors
Use the wildcard [*] to get all authors from an array of books.
Get all prices
Use recursive descent .. to find every price key anywhere in the JSON.
Access a nested property
Use dot notation to reach a deeply nested value.
Frequently asked questions
What is JSONPath?
What is JSONPath?
JSONPath is a query language for JSON data. It lets you specify a path to one or more values inside a JSON document, much like XPath does for XML. For example, $.store.book[0].title retrieves the title of the first book in the store.
What syntax does this tester support?
What syntax does this tester support?
It supports dot notation ($.store.book), bracket notation ($['store']['book']), array indices ([0], [-1]), wildcards (*), recursive descent (..), slices ([0:2], [0:4:2]), and unions ([0,2]). Filter expressions (e.g., ?(@.price < 10)) are not yet implemented.
Does this tool support filter expressions like ?(@.price < 10)?
Does this tool support filter expressions like ?(@.price < 10)?
Not at the moment. The tester focuses on the most widely used JSONPath features — property access, wildcards, recursion, and slices. Filter support may be added in a future update if there is enough demand. For advanced filtering you can combine the matched results with array methods in your own code.
How do I access a specific array element?
How do I access a specific array element?
Use an integer index inside square brackets. $.store.book[0] gives you the first book, $.store.book[-1] gives you the last one. If the index is out of range, the path simply returns no matches.
How do I get all values with a certain key?
How do I get all values with a certain key?
Use the recursive descent operator .. followed by the key name. For instance, $..price will find every occurrence of the key price anywhere in the JSON structure.
Can I use wildcards?
Can I use wildcards?
Yes. $.store.book[*] selects all elements of the book array, and $.store.book[*].* selects every value inside each book. In bracket notation you can also use $['store']['book'][*].
What does .. do?
What does .. do?
The .. (recursive descent) operator searches for a key at any nesting level. $..author will match any author key, whether it appears at the root, inside an object, or deep within nested arrays.
Is my JSON data secure?
Is my JSON data secure?
Absolutely. All evaluation happens locally in your browser. No data is uploaded, stored, or shared — you can work with sensitive API responses without risk.
Why does my query return no results?
Why does my query return no results?
A common reason is a slight typo in the path or key names (JSONPath is case‑sensitive). Double‑check the exact spelling and structure of your JSON. Also ensure you haven’t accidentally mixed dot and bracket notation in a way that breaks the expression — the tool will show an error message if the syntax is invalid.
Can I use this tool offline?
Can I use this tool offline?
Yes! The tester is a static web page that works entirely on the client side. Once loaded, you can disconnect from the internet and continue using it. There is no backend dependency.
Related tools
More utilities you might find handy.
.env File Generator
Quickly generate clean, properly-quoted .env files from key-value pairs — no more quoting errors or broken deployments.
.htaccess Redirect Builder
Generate error-free Apache .htaccess code for 301 redirects, HTTPS enforcement, and canonical URL routing.
ASCII Converter – Text to ASCII, Hex, Binary & Back
Convert text to ASCII codes and decode back in decimal, hex, binary, or octal — live, private, and 100% browser-based.