JSONPath Tester and Evaluator

Type a JSONPath expression and see the matching values of your JSON document, each with its normalized path.

Loading tool…

About the JSONPath Tester

JSONPath selects values from a JSON document the way XPath does for XML. $ is the root, .name or ['name'] selects a property, [0] an array item, * every child and .. searches at any depth. [0,1] is a list of indexes, [1:3] a slice (start, end, step) and [-1:] the last item. Example: $.store.book[*].author returns the author of every book.

Filters keep the items for which a condition is true: $..book[?(@.price < 10)], where @ is the current item and @root the whole document. Conditions can use comparisons, &&, ||, ! and methods of the value such as @.title.match(/of/i) or @.tags.includes('x'). [?(@.isbn)] keeps the items that have the property. The expression is evaluated with jsonpath-plus in its safe mode: filter scripts are parsed and interpreted, never passed to eval, and they cannot reach anything outside the document.

Each match is listed with its normalized path, for example $['store']['book'][0]['title'], which identifies exactly one value. The output holds the values, the paths or both as JSON. This engine follows the original JSONPath article by Stefan Gössner with some extensions: ~ returns property names and ^ the parent. It differs from RFC 9535 in places: filters need parentheses, [?(@.price < 10)], and functions such as length() or match() are written as JavaScript properties and methods.

How to use it

  1. Paste a JSON document or open a .json file.
  2. Type an expression, or click one of the examples.
  3. Read the matches: path, type and value.
  4. Choose values, paths or both, then copy or download the JSON.

Frequently asked questions

What is the difference between . and ..?
$.store.price selects the property price of store only. $.store..price searches every level below store and returns all properties named price.
How do I select by a key with spaces or dashes?
Use bracket notation with quotes: $['content-type'] or $.headers['x-request-id'].
Why does my filter return nothing?
Filters apply to the children of the value before them. $.store.book[?(@.price < 10)] tests each book. Also check the types: "10" is a string, so compare it with a string or use loose equality (==).
Do all JSONPath implementations give the same result?
No. JSONPath was standardised only in 2024 (RFC 9535) and libraries differ in filters, script expressions and extensions. Test an expression with the library your application uses when the details matter.

Related tools