What is JSONPath?
JSONPath is a query language for JSON, similar to XPath for XML. A short expression such as $.store.book[*].title picks values out of a document, and it's used in API testing tools, Kubernetes, log processors, database queries and many programming libraries.
This tester runs an expression against JSON you paste and shows every match, either as a JSON array of values, a list of normalised paths, or an object mapping each path to its value. Errors in the JSON or the expression are explained in plain words. Both the data and the query can be edited freely, and results update with every keystroke, which makes it easy to build a complex filter one step at a time.
How to use the JSONPath tester
1.Paste your JSON
Or use the bookstore sample.
2.Type a JSONPath
Results update as you type.
3.Choose the output
Matching values, their paths, or both.
Example: queries on the bookstore sample
A store with four books and a bicycle:
- $.store.book[?(@.price < 10)].title
- Sayings of the Century, Moby Dick
- $..book[-1:].author
- J. R. R. Tolkien
- $.store.*.price (paths)
- $.store.bicycle.price
Each query is confirmed against real data before it goes into code.
Supported syntax
$ is the root. Use .name or ['name'] for keys, [0] or [-1] for array items, [*] or .* for everything at a level, and .. to search at any depth, as in $..author. Slices like [0:2] and [::2] pick ranges; [0,2] and ['a','b'] pick several.
Filters select items by their contents: [?(@.price < 10)], [?(@.isbn)] for items that have a key, and conditions combined with && and ||. Comparisons are ==, !=, <, <=, > and >=, and =~ /pattern/ matches text against a regular expression.
Frequently asked questions
Which JSONPath version is this?
The widely used Goessner syntax, which most libraries and tools follow.
Why do I get no matches?
Key names are case-sensitive. Try $..name to search at every depth.
Can a filter compare two fields?
Yes, like [?(@.sale < @.price)].
Is my JSON uploaded?
No. Queries run locally.
Related tools
JSON viewer
Explore JSON as a collapsible tree, search it and copy paths.
JSON Formatter & Validator
Pretty-print, minify, sort and validate JSON with line-numbered errors.
Flatten & Unflatten JSON
Flatten nested JSON to dotted keys, or unflatten it back.
JSON ↔ CSV Converter
Convert JSON arrays to CSV and CSV back to JSON.
JSON to TypeScript Interface Generator
Generate TypeScript interfaces or types from a JSON sample.
JSON ↔ YAML Converter
Convert JSON to YAML and YAML to JSON.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table