JSONPath Tester

Write a JSONPath expression and see every matching value from your JSON as you type, with the exact path of each match. Try child and descendant selectors, wildcards, indexes, slices and filters with comparisons, regular expressions and &&/||. Example expressions are one click away, so you can learn the syntax on a sample and then paste your own API response.

2 matches
[
  "SAR-02",
  "DUP-07"
]
Paths
$['store']['products'][1]['sku']
$['store']['products'][2]['sku']

Querying runs in your browser. What you type never leaves this device.

Features

  • Child, descendant (..), wildcard, index and slice selectors

  • Filters: ==, !=, <, <=, >, >=, =~ /regex/, !, && and ||

  • length() and .length in filters

  • Each match listed with its normalized path

  • Clear errors with the position of a syntax mistake

  • Runs in your browser

Where JSONPath is used

API tests and monitors

Postman, k6 and many monitoring tools pick values out of responses with JSONPath; test the expression here first.

Kubernetes and kubectl

kubectl -o jsonpath uses the same idea to pull fields from cluster objects.

No-code automations

Workflow tools ask for a JSONPath to map a webhook field into the next step.

JSONPath cheat sheet

Selectors

  • $ is the root; .name or ['name'] selects a key.
  • [0] is the first item, [-1] the last, [*] or .* all items.
  • ..name finds the key at any depth.
  • [0:2] takes items 0 and 1; [::-1] reverses.

Filters

  • [?(@.price < 2000)]: @ is the current item.
  • [?(@.isbn)]: items that have the key.
  • [?(@.name =~ /saree/i)]: regular expression match.
  • [?(@.price < $.limit)]: compare with a value elsewhere in the document.

Dialects

This tester follows RFC 9535, the JSONPath standard, for the common syntax, and also accepts the older ?(...) filter form. Script expressions like (@.length-1) from old libraries are not run. Other JSON tools: JSON formatter and validator, JSONPath tester, JSON to TypeScript and JSON to CSV.

JSONPath Tester - FAQ