JSONPath Tester

Query JSON with JSONPath expressions and see matches live, with the exact path to each one

Ctrl+Enter to run

Quick examples:

Enter an expression and press Run

Supported syntax

  • $ root Β· . child Β· .. recursive descent (any depth)
  • [*] wildcard Β· [0] index Β· [-1] from the end
  • [0,2] multiple indices Β· [0:2] slice (start:end:step)
  • Filter expressions like [?(@.price<10)] aren't supported

About this tool

The ToolNinja JSONPath Tester lets you run JSONPath queries against any JSON document and see every match instantly, along with the exact resolved path to each one. It's the JSON equivalent of the XPath Tester β€” same live-results workflow, applied to JSON instead of XML/HTML. The tester supports the core JSONPath syntax developers actually use day to day: the root $, dot and bracket child access, the .. recursive descent operator for finding a key at any depth, [*] wildcards, [start:end:step] array slicing, and [0,2,4] multi-index selection. Filter expressions like [?(@.price<10)] require evaluating arbitrary predicate code and aren't supported β€” for conditional filtering, pair a broader query here with your own application code. Everything runs 100% in your browser. Your JSON β€” including any sensitive API response data β€” never leaves your machine.

When to use it

  • β†’Figuring out the right JSONPath expression to extract a field from a deeply nested API response
  • β†’Debugging why a JSONPath query in your application code isn't matching what you expect
  • β†’Exploring an unfamiliar JSON structure by querying it interactively instead of reading it line by line
  • β†’Writing JSONPath expressions for tools that use them as config (Elasticsearch, AWS CLI --query, JSONPath-based test assertions)

Tips

  • β—†$..price finds a key named price anywhere in the document, no matter how deeply nested β€” useful for exploring unfamiliar JSON.
  • β—†Negative indices count from the end: [-1] is the last array element, [-2:] is the last two.
  • β—†Ctrl+Enter runs the query without leaving the expression field.

Frequently asked questions

What's the difference between JSONPath and just writing JavaScript to walk the object?

JSONPath lets you express a query declaratively in one line instead of writing a loop, and it's portable β€” the same expression works the same way across languages and tools (CLI utilities, API gateways, test frameworks) that all implement the JSONPath spec, unlike a JS traversal function tied to one codebase.

Why doesn't my filter expression like [?(@.price<10)] work?

Filter expressions require a full predicate evaluator capable of running arbitrary comparison logic safely, which is a meaningfully larger (and riskier, if not sandboxed carefully) scope than query/path resolution. This tool supports the structural part of JSONPath β€” paths, wildcards, slices, recursive descent β€” but not conditional filtering.

Does JSONPath have one official standard, like XPath does for XML?

Mostly, though historically less formally β€” the original Stefan Goessner JSONPath proposal became a de facto standard, and RFC 9535 (2024) has since formalized it. Implementations still vary slightly in edge cases (especially around filter expressions), so always test against the actual library or tool you're targeting.

Related tools

πŸ₯· ToolNinja