What is JSONPath and why do I need a tester for it?
You have a JSON document. Could be an API response, a config file, a log line, anything. Inside is some piece of data you want to pull out: the third user's email, every price under 10 dollars, all the image URLs nested 4 levels deep. Writing a JavaScript loop for that is fine, but slow and noisy. JSONPath is the shortcut: a tiny query language built for JSON, modeled on XPath for XML. One line, you get the values.
This tester runs your expression live as you type. Paste JSON on the left, type a JSONPath like `$.store.book[*].title` on the right, see the matching values on the right too. Nothing leaves your browser, the JSON stays on your machine, which matters when you are debugging a production response with real user data in it.
The tool ships with Goessner's classic bookstore example (the JSON every JSONPath tutorial uses) so the cheat sheet and example chips work out of the box. Click an example to load it, tweak the expression, see what changes. You will learn the syntax faster by playing with a working query than by reading docs.
How to use it
- Paste your JSON into the left textarea. Click Format to pretty-print it (4-space indent, sorted nothing, just readable). If the JSON is broken (missing comma, unclosed bracket) you get a red Invalid JSON badge above the editor: fix it and the badge clears.
- Type a JSONPath expression in the input on the right. The result updates on every keystroke, no run button. Start with `$` (the root of the document) and dig down with `.field` or `[index]`. The example chips below are clickable starting points.
- The Result panel shows the matched values as JSON. Match count is in the top right, an empty match returns "no matches" instead of an empty array, so you know your expression ran without errors.
- Toggle Show paths to switch the output from values to JSON paths (like `$.store.book[0].title`). Useful when you want to know where something is rather than what it is.
- Click Copy to put the result on your clipboard. Click Load sample any time to reset to the bookstore document. Click Clear to wipe both panes.
- Use the cheat sheet at the bottom: every row is clickable, the example loads itself into the query box (and resets the JSON to the sample) so you can see exactly what each operator does.
When this is useful
Six concrete situations where JSONPath beats writing a custom loop:
- Debugging API responses. You hit an endpoint, the response is 80 KB of nested JSON, and you need just the user IDs from the second page of results. Type `$.data.users[*].id` and you have them. No need to write a script, no need to open the response in an IDE, no need to copy paste fragments.
- Extracting fields from a config file. You have a 2000-line Kubernetes manifest or Helm values.yaml (converted to JSON) and you want every container image used in the cluster. `$..spec.containers[*].image` and done. The recursive descent (`..`) does not care how deep the containers are nested.
- Filtering by condition. You have a product catalog with 400 items and you need the ones priced under 10 dollars. `$.products[?(@.price < 10)]` returns them all, no SQL, no Excel, just paste and type. Combine with `&&` for multiple conditions: `[?(@.price < 10 && @.inStock)]`.
- Learning the syntax before using it in code. Many libraries take JSONPath as input: jq alternatives, Postman test scripts, Grafana panels, Azure Logic Apps, AWS Step Functions, Camel routes. Test the expression here first, then paste it into the real tool with confidence.
- Building automation rules. You wire up Zapier, n8n, Make, Pipedream: most of them have a "JSONPath" filter step. You sketch the filter here with the actual webhook payload, then drop the working expression into the rule.
- Quick data exploration. You exported your data from somewhere (Notion, Airtable, Stripe, GitHub API) as JSON and you want to answer a question fast. "How many invoices over $500 in this dataset?" `$..invoices[?(@.amount > 500)]`, count the matches, done. Faster than spreadsheet tricks.