Hunt
Skip to content

JSONPath Tester

Type a JSONPath query and paste JSON to see what it selects: every match is listed with its normalized path and highlighted in the document. The tester follows RFC 9535, the JSONPath standard published in 2024, so filters, slices and functions behave exactly as specified. Nothing is uploaded.

Runs in your browser

JSON

Matches

Type a query and paste JSON to see the matches.

JSONPath syntax

  • $ is the root; .name or ['name'] selects a member, and [0] an array element ([-1] counts from the end).
  • * selects all members or elements; .. searches at every depth, so $..price finds every price.
  • [1:3] is a slice (elements 1 and 2); [::2] takes every second element.
  • [?@.price < 10] filters: @ is the current item, with ==, !=, <, <=, >, >=, &&, || and !. [?@.isbn] keeps items that have an isbn.
  • [0,2] or ['a','b'] selects several at once.

How to use the JSONPath Tester

  1. Paste JSON, or choose an example query, which loads sample data.
  2. Type a JSONPath query. Matches update as you type.
  3. Select Show to jump to a match in the JSON.
  4. Copy the matched values as a JSON array, or their paths.

Examples

Filter by a value

Input
query: $.books[?@.price < 10].title
data: {"books":[{"title":"Sayings","price":8.95},{"title":"Moby Dick","price":8.99},{"title":"The Lord of the Rings","price":22.99}]}
Output
[
"Sayings",
"Moby Dick"
]

Every price, at any depth

Input
query: $..price
data: {"books":[{"price":8.95},{"price":22.99}],"bicycle":{"price":399}}
Output
[
8.95,
22.99,
399
]

Items with a property, and the last item

Input
query: $.books[?@.isbn].title
data: {"books":[{"title":"A"},{"title":"B","isbn":"0-553-21311-3"},{"title":"C","isbn":"0-395-19395-8"}]}
Output
[
"B",
"C"
]

$.books[-1].title would select only "C", the last book's title.

Functions

  • length(@.title): the length of a string, array or object.
  • count(@.tags[*]): the number of nodes a query selects.
  • match(@.email, '.*@example\.com'): the whole string matches a regular expression; search(@.name, 'Ada') finds it anywhere.
  • value(@..price): the value of a query that selects one node.

Why the standard matters

Before RFC 9535, every JSONPath library had its own dialect: filter syntax (?(@.price < 10) or ?@.price < 10), what .. returns, and whether scripts were allowed all varied. Many online testers still use one of those dialects. This tester follows the standard, which newer libraries (and databases adopting SQL/JSON-style paths) implement. Older forms such as ?(…) with parentheses are still accepted, because the parentheses are valid grouping.

Limitations

  • Function extensions beyond the five in RFC 9535 aren't available.
  • Very large documents with .. queries can take a moment.

Frequently asked questions

Is my JSON uploaded?

No. Queries run in your browser; nothing you paste is sent anywhere.

Why doesn't my query from another tool work?

It may use a pre-standard dialect: script expressions such as $.books[(@.length-1)] and some functions aren't part of RFC 9535. Use [-1] for the last element and the standard functions instead.

What is a normalized path?

A canonical way of writing the location of one value, defined by RFC 9535, such as $['books'][0]['title']. It always uses bracket notation, so it's unambiguous even for keys with spaces or dots.

How do I find the path to a value?

Open the JSON in the JSON Viewer and select the value: its path is shown and can be copied.