JSONPath Tester
Guide: How to Fix the Most Common JSON Errors
Nothing you enter or choose here leaves your device. This tool runs in your browser.
A query on a bookstore
JSONPath is a small language for picking values out of JSON. Say your data is a store with a list of books, each with a title, a price and a category, and a bicycle with its own price. Here are queries you can paste in with that data, and what they return:
| Query | What it returns |
|---|---|
$.store.book[*].title | Every book title |
$.store.book[0,2].title | The titles of the first and third books |
$.store.book[-1:] | The last book |
$..price | Every price anywhere in the document |
$.store.book[?(@.price < 10)].title | Titles of books under 10 |
$.store.book[?(@.price < 10 && @.category == 'fiction')].title | Cheap fiction only |
The building blocks
$is the root of the document. Every query starts with it..nameselects a key.['name']does the same when the key has spaces or symbols.[0]picks an item by position, counting from zero. A negative number counts from the end.[*]selects everything at that level.[0:2]is a slice, from item 0 up to but not including item 2...searches at every depth, so$..pricefinds prices wherever they hide.[?(...)]filters. Inside,@means the current item.
Why you get no matches
- Check that the path starts with
$. - Check the spelling and the capital letters of key names. They have to match exactly.
- Check that quotes and brackets are balanced.
- In filters, check the type. The number 10 and the text "10" are different, and a comparison between them finds nothing.
- Look at the data. A key you expect may sit one level deeper, so try
$..keyto find it.
Every match shows where it came from
Each result lists the path to the value, such as $.store.book[1].title. That's useful when a recursive search finds more than you wanted, since you can tell the matches apart. Copy values gives you the results as a JSON list.
Safe to paste any query
Filter expressions are read by a small parser built into the page. They're never run as JavaScript, so a query copied from somewhere else can't execute code.
A note on dialects
JSONPath isn't a single strict standard, and tools differ on edge cases like filter syntax and what a missing key returns. If a query works here and not in your library, check its documentation on filters and on recursive search.
Everything runs in your browser. Tidy the data first with the JSON formatter, compare two versions with the JSON diff, which prints paths in the same style, or describe its shape with the JSON schema generator.
Written by Akinrinmade Michael · Updated October 24, 2026
How to use
- 1Paste your JSON into the left box.
- 2Type a JSONPath expression, or click an example.
- 3Read the matches and their paths on the right.
- 4Click Copy values to copy the results as a JSON list.
Frequently asked questions
What is JSONPath?
A query language for JSON, similar to XPath for XML. $ is the root, a dot selects a key, and [*] selects every item, so $.store.book[*].title lists every book title.
Which features are supported?
Child names, array indexes (including negative), wildcards, slices like [0:2], unions like [0,2], recursive search with .., and filters such as [?(@.price < 10 && @.category == 'fiction')].
Why do I get no matches?
Check the spelling and the case of key names, that your path starts with $, and that quotes are balanced. Filters only compare values of the same type, so 10 and "10" are different.
Does it run my filters as code?
No. Filter expressions are read by a small built-in parser, never evaluated as JavaScript, so pasted queries can't run code.
Read the guide
Learn how this works and how to get the most from it.
Developer
How to Fix the Most Common JSON Errors
Trailing commas, single quotes, unquoted keys and more. Learn to read a JSON error message and fix invalid JSON quickly.
4 min read
Related tools
JSON Formatter & Validator
Prettify, minify and validate JSON, with error line numbers.
JSON Diff
Compare two JSON documents and see what changed, ignoring key order.
JSON Schema Generator
Generate a JSON Schema from a sample JSON document.
YAML ⇄ JSON Converter
Convert YAML to JSON and JSON to YAML with error line numbers.