How to use it
- Paste your JSON, drop a file on the box, or press Example.
- Type a JSONPath in the JSONPath field, such as
$..price. Matches appear as you type. - Choose Values to see the matched values as a JSON list, or Paths to see where each match is.
Examples
| JSONPath | Result |
|---|---|
$.store.book[0].title | The title of the first book |
$..price | Every price, at any depth |
$.store.book[-1] | The last book |
$.store.book[0:2] | The first two books |
$.store.book[?@.price < 10] | Books that cost less than 10 |
$.store.book[?@.isbn] | Books that have an isbn field |
$..book[?match(@.author, 'A.*')] | Books whose author starts with A |
What is supported
The tester follows the JSONPath standard, RFC 9535: names, indexes, slices, *, recursive search with .., lists such as [0,2], and filters with == != < <= > >=, &&, || and !. The functions length(), count(), match(), search() and value() are available. Older JSONPath tools differ in places, for example in script expressions such as (@.length-1), which are not supported.
Limits
Up to 10,000 matches are listed. Matched values keep their original spelling, so large numbers keep every digit, but filters compare very large numbers as rounded values. The path of a box in the JSON graph viewer can be pasted here.
Example
Made-up input, and what JSONPath Tester returns for it. Long text is shortened.
{
"store": {
"book": [
{
"title": "Sample Book One",
"author": "A. Writer",
"price": 8.95,
"tags": [
"guide"
]
},
{
"title": "Sample Book Two",
"author": "B. Author",
"price": 12.99,
"isbn": "0-000-00000-0"
},
{
"title": "Sample Book Three",
"author": "A. Writer",
"price": 22.5,
"isbn": "0-000-00000-1"
…[
"Sample Book One",
"Sample Book Two"
]Questions
Is this the same as jq?
No. jq is a different query language. This tester uses JSONPath.
Is my JSON uploaded?
No. The query runs in your browser, and the editor cannot send requests.