JSONPath Tester

Test JSONPath expressions against your JSON.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

JSONPath Tester – Evaluate JSONPath Expressions Online

The JSONPath tester runs a JSONPath expression against your JSON and shows every match instantly. Edit the expression and the results update as you type, so you can build and debug queries for APIs, test frameworks, and data pipelines in seconds.

JSONPath in a nutshell

JSONPath is to JSON what XPath is to XML: a compact way to select values from a document.

Expression Meaning
$ the root
$.store.name a child key
$.store.book[0] first array item
$.store.book[-1:] last item (slice)
$.store.book[*].author every author
$..price every price at any depth
$..book[?(@.price < 10)] books cheaper than 10
$..book[?(@.isbn)] books that have an isbn

Three output modes

  • Matched values – a JSON array with the selected values.
  • Matched paths – the normalized path of each match, like $['store']['book'][2]['title'].
  • JSON Pointers – RFC 6901 pointers such as /store/book/2/title, useful for JSON Patch.

Where JSONPath is used

API testing tools such as Postman and Karate, Kubernetes kubectl -o jsonpath, AWS Step Functions, logging and monitoring platforms, and many ETL tools accept JSONPath to extract values. Testing expressions here against real sample data is far quicker than trial and error in those tools.

Tips for writing expressions

Start simple and grow the query step by step: select the parent array first, add a wildcard, then add a filter. Remember that key names are case-sensitive and that filters use @ for the current item. The match counter below the editors tells you immediately whether a change widened or narrowed the result set.

Find the path to a single value by clicking it in the JSON Viewer, or search keys and values in the JSON Navigator.

Frequently Asked Questions

The common Goessner syntax: $ for the root, .key and ['key'] for children, [n] and [start:end:step] for array indices and slices, * for wildcards, .. for recursive descent, [a,b] unions, and filter expressions like [?(@.price < 10)] or [?(@.isbn)].

Yes. Filters are evaluated by a restricted, sandboxed interpreter from the jsonpath-plus library, not with eval, and everything runs locally in your browser.

A JSONPath like $['store']['book'][0] is a query language that can match many values. A JSON Pointer (RFC 6901) like /store/book/0 always points to exactly one location and is used by JSON Patch and JSON Schema $ref.

Check that it starts with $, that key names match exactly (they are case-sensitive), and that you're indexing arrays with [ ] rather than dots. Use the JSON Viewer to click a value and copy its exact path as a starting point.