How to use it
- Paste the JSON document into JSON document. Use the example to try the tool first.
- Type the JSONPath query in the field below it, starting with $. Filters go in brackets: [[email protected] < 10].
- Read the Matches count, then the Matches, in order table: each row has the path of a match and its value.
- If a message shows the position of a problem, look at that character of the query and fix the brackets, quotes or dots.
How a query selects nodes
A query is a list of segments after $. A child segment such as .store or [0] selects the children of each node that it reaches, and a descendant segment such as ..author visits the node and all of its descendants before it selects. The nodes of one segment come in the order of the input, and an array is always read in its order (RFC 9535, sections 2.5 and 2.5.2.2).
A name selector matches a member with exactly that name and only in an object. A negative index counts from the end of an array, so -1 is the last element. A slice such as [1:5:2] takes the start, the end and the step, and a step of 0 selects nothing (section 2.3.4.2).
Filters, functions and what the tool refuses
A filter [?...] tests every child of an array or object. Comparisons use ==, !=, <, <=, > and >=; && , || and ! combine tests, and parentheses group them. A member that is missing is Nothing, and two Nothing values are equal. Numbers compare with numbers, text with text, and a value of one type is never equal to a value of another type (section 2.3.5.2).
The functions length, count, value, match and search are supported as RFC 9535 defines them. match and search take a regular expression written in I-Regexp, the format of RFC 9485; a pattern that is not valid I-Regexp matches nothing. Array and object literals are not part of the grammar, so the tool refuses them, and it refuses a function result used alone in a filter, because RFC 9535 says that is not well-typed.
The bookstore example
With the example document and the query $.store.book[[email protected] < 10].title, the books cheaper than 10 are the first and the third. Their titles are the two matches below, with the normalized path of each.
| Normalized path | Value (JSON) |
|---|---|
| $['store']['book'][0]['title'] | "Sayings of the Century" |
| $['store']['book'][2]['title'] | "Moby Dick" |
Frequently asked questions
Why does a query return nothing when the key exists?
A name selector matches only a member of an object with exactly that name, and the comparison is case-sensitive. It never matches an element of an array, so use an index or a wildcard for an array.
Why are 13 and "13" not equal in a filter?
RFC 9535 compares values of different types as not equal (section 2.3.5.3). A number and a text are different values, so == is false and != is true, even when the characters look the same.
What does a negative index select?
A negative index counts from the end of the array: -1 is the last element and -2 the one before it. An index outside the array selects nothing and is not an error (section 2.3.3.2).
Why does the tool refuse length(@) when it is alone in a filter?
length returns a number, and a filter needs a test that is true or false. Compare the result, as in [?length(@.title) > 15], which is well-typed.
Does the tool send my JSON to a server?
No. The document is read by your browser with JSON.parse, the query runs there too, and nothing is stored. The page makes no network request.
Sources
- RFC 9535, JSONPath: Query Expressions for JSON, sections 1.5, 2.3, 2.4, 2.5 and 2.7
- RFC 9485, I-Regexp: An Interoperable Regular Expression Format, sections 3 and 5.3
Figures and text last checked on Tuesday, November 10, 2026.