What a JSONPath tester does
JSONPath is a short query language for picking values out of a JSON document, much like XPath does for XML. A jsonpath tester lets you try a query on real data and see exactly which values it selects before you put that query into code, a config file or a monitoring rule.
This tool follows RFC 9535, the IETF standard for JSONPath published in 2024. It reads the query, checks it against the grammar, and evaluates it on your document in the browser. Every match is listed with its normalized path, so you can see where each value came from and not only what it is.
A worked example
Press Example to load a plant shop with five products. This query keeps products that cost less than 25 and need low light, then takes their names:
$.shop.products[?@.price < 25 && @.light == 'low'].nameThe tester returns two matches:
[
"Snake Plant",
"ZZ Plant"
]Switch the output to normalized paths and a query such as $.shop.products[?@.stock == 0].sku returns $['shop']['products'][1]['sku'] . Normalized paths are the standard way to name one exact node, which helps when you log a result or compare two runs.
JSONPath syntax supported by this evaluator
$is the root of the document and@is the current item inside a filter..nameor['name']selects a member. Use brackets for names with spaces, dots or quotes.*selects every member of an object or every item of an array...searches the current node and everything nested inside it, for example$..price.[0]selects an index and[-1]counts from the end.[start:end:step]is a slice, so[::2]takes every second item and[::-1]reverses the array.[0,2]or['lat','lng']is a union of several selectors.[?@.price < 10]is a filter. Filters support ==, !=, <, <=, >, >=, &&, || and ! with parentheses.
A filter that names a path without a comparison tests whether it exists. Existence is not the same as truthiness: $.shop.products[?@.discount].name returns Monstera Deliciosa and ZZ Plant, because ZZ Plant has a discount key whose value is null.
Filter functions: length, count, match, search and value
length(@.tags)gives the length of a string in characters, of an array in items, or of an object in keys.count(@.tags[?@ == 'easy'])counts the nodes a path selects.match(@.sku, '[A-Z]{3}-0[1-3]')is true when the whole string matches the pattern.search(@.name, 'Plant')is true when the pattern appears anywhere in the string.value(@..color)turns a path that selects exactly one node into its value.
The evaluator checks function types the way the standard does. length(), count() and value() return a value, so they must be compared. match() and search() return true or false, so they stand on their own and cannot be compared with == true.
Strict RFC 9535 mode and older JSONPath forms
Many queries online were written for the original 2007 JSONPath article or for the Jayway Java library. With Strict RFC 9535 off, the tester accepts a few of these forms when their meaning is clear, and it adds a note that shows how each one was read:
- A query without the leading $, such as
store.book, gets $ added in front. [(@.length-1)]is read as the index-1.@.author =~ /.*tolkien/iis read as a full match with a JavaScript regular expression.- Dot names with a dash, such as
$.first-name, are read as$['first-name']. - Spaces around the whole query are ignored.
Turn Strict RFC 9535 on to check that a query will work in any compliant library. Jayway path functions such as .length() and operators such as in are not accepted in either mode. The error message suggests the standard way to write them.
Errors with an exact column
When a query cannot be read, the tester shows the column and a caret under the problem, and it says how to fix it. For example, $.shop.products[?@.price < ] gives:
Column 28: "]" cannot start a value. Use @ for the current item, $ for the root, a number, 'text', true, false, null or a function.A common mistake is comparing a path that can select many nodes. @.tags[*] == 'easy' is rejected because a comparison needs at most one value. Use count(@.tags[?@ == 'easy']) > 0 instead. Errors in the JSON document are reported with their line and column too, and Go to error selects the spot.
Output formats and options
- Values: a JSON array of the matched values, pretty printed or minified.
- Normalized paths: one path per line, such as
$['shop']['products'][1]. - Path and value pairs: a JSON array of objects with a path and a value.
- JSON Pointers: one RFC 6901 pointer per line, such as
/shop/products/1/name. - Unique matches removes nodes that a union or a .. search selected more than once. The standard keeps duplicates, so this is off by default.
- Allow comments in JSON ignores // and /* */ comments and trailing commas in the document.
Limits and privacy
The tester handles documents up to 2,000,000 characters. The list shows the first 500 matches, and copy and download include all of them up to 20 million characters. A query stops after 5,000,000 steps, or after 5 seconds, so a deep .. inside another .. cannot freeze the page. Numbers with more than 15 significant digits may lose their last digits, and the tool warns when it finds them. Object members are listed in the order the browser keeps them, which puts keys that look like whole numbers first.
The query runs in a background worker in your browser. Your JSON is not uploaded, as the Privacy Policy explains. To check data against a schema, use the JSON Schema Validator. To turn nested JSON into flat key paths, try JSON Flatten, and for files with one record per line, open the JSONL Viewer. Sort JSON Keys puts members in a stable order before you compare results.