dev101.io

JSONPath Evaluator

Query JSON documents with JSONPath expressions — privately, in your browser.

Loading tool…

How to use JSONPath Evaluator

  1. Paste JSON into the left pane.
  2. Type a JSONPath expression into the path input on the right, e.g. `$.store.book[*].title`.
  3. Watch the results populate live — matched values appear as JSON, and canonical paths appear below them one per line.
  4. Press ⌘/Ctrl + Enter to persist the query into a shareable URL.
  5. Click "Load sample" to try the classic RFC 9535 bookstore document.

JSONPath Evaluator

A JSONPath query tool that runs entirely in your browser. Paste JSON, type a path, get matches and their canonical paths side by side. Live evaluation, zero round-trips, no telemetry.

What JSONPath is

JSONPath is a query language for JSON. It was proposed by Stefan Goessner in 2007, became the de facto way to address pieces of a JSON document in tooling like kubectl -o jsonpath, CloudWatch dashboards, and most monitoring UIs, and was finally standardized as RFC 9535 in 2024. Think of it as XPath for JSON — a path expression that selects zero or more nodes from a tree.

A JSONPath expression always starts with $ (the root). From there, you chain segments:

  • .name or ['name'] — select a member of an object.
  • [0] — index into an array (negative indices count from the end, RFC 9535 style).
  • [*] or .* — wildcard: every child of an array or object.
  • ..name — recursive descent: find every descendant with the given key, at any depth.
  • [start:end:step] — array slice, with all three bounds optional.
  • [?(<expr>)] — filter: keep only children where the expression is truthy.

Supported filter operators

Inside [?(…)], you can build predicates using the current node (@):

  • Comparison: ==, !=, <, <=, >, >=
  • Logical: &&, ||, !, with parentheses for grouping
  • Paths: @.foo, @.foo.bar, @['weird key']
  • Literals: numbers (42, 3.14, -7), quoted strings ('fiction', "fiction"), true, false, null
  • Existence: a bare path like [?(@.isbn)] is truthy whenever the key is present and non-falsy

Example: find every fiction book under $10.

$.store.book[?(@.category == 'fiction' && @.price < 10)]

What's not supported (yet)

  • Script expressions ([(@.length - 1)]) — standardized as an optional extension in RFC 9535, deliberately omitted here. If you need to index from the end, use [-1].
  • Function extensionslength(), count(), match(), search(), value() are not parsed. A future release may add the core five.
  • Unions$.a[0,2,4] (index union) and $.a[(name == 'x'),(name == 'y')] are not supported. Evaluate multiple queries separately.
  • Regex filters — there is no ~= or match() operator. Post-process with the regex tester if you need pattern matching.

How it compares

  • vs JMESPath — JMESPath (used by AWS CLI --query) is a different language, not a superset. It has cleaner array projection syntax and a rich function library, but it is not what kubectl or CloudWatch speak. Pick your dialect based on the tool you're targeting.
  • vs jqjq is a full functional language that happens to use JSON-like syntax. It can do everything this tool does and much more, but it is a separate runtime you install. If you just need to extract a few fields while building a query to paste into a kubectl flag, this is faster.
  • vs JSON.parse(x).a.b[0] — hand-written property access is faster for a single lookup but breaks on missing intermediate keys and doesn't handle wildcards or recursion. JSONPath is the expressive escape hatch.

Keyboard shortcuts

  • ⌘/Ctrl + Enter — re-run the query and persist the state into the URL hash
  • ⌘/Ctrl + K — open the global command palette (jump to another tool)

Privacy promise

Nothing you paste ever leaves your device. The page loads no analytics scripts, no third-party fonts, no trackers. Share links put state in the URL fragment, which by specification is never transmitted to a server. Even the "Copy matches" / "Copy paths" buttons run entirely in-page via the Clipboard API.

Performance notes

The evaluator caps recursion at depth 100 to protect against pathological documents. Wildcards and recursive descent traverse every descendant — on very large documents (hundreds of MB), this is O(n) in the document size. If you hit a slow query, pre-filter the document with a narrower path before running a .. descent.

Frequently asked questions

Is the JSON I paste sent to your servers?

No. The JSONPath tool runs entirely in your browser. The parser, evaluator, and output rendering all execute on your device. There is no network request made with your payload — the page has no JSON-handling endpoint. Share links encode state into the URL fragment (after `#`), which by HTTP design is never forwarded to any server.

Which JSONPath dialect does this use?

A practical subset of RFC 9535 (JSONPath, 2024). Supported — `$` root, `.name` and `['name']` member access, `[n]` and `[-n]` indexing, `[*]` and `.*` wildcards, `..name` recursive descent, `[start:end:step]` slices, and filter expressions with `==`/`!=`/`<`/`<=`/`>`/`>=`, `&&`/`||`, parentheses, and literals (numbers, quoted strings, `true`, `false`, `null`). Not supported — script expressions, function extensions (`length()`, `count()`), and union expressions like `[0,2,4]`. If you need those, use `jq` or a CLI JSONPath implementation.

Why does `@.foo` return nothing when `foo` is absent?

A missing key resolves to a typed "absent" value, which compares unequal to every literal and fails every order comparison. That way `[?(@.isbn)]` works as an existence check without matching on falsy values like `0` or `""`. If you want to include nulls, use `[?(@.foo == null)]` explicitly.

How does this compare to JMESPath?

JMESPath has a different syntax (`store.book[*].price`, `books[?price < `10`]`) and a richer function library. It is often preferred for config transforms. JSONPath is older and is the dialect supported by AWS CloudWatch, Kubernetes `kubectl -o jsonpath`, and most monitoring tools. If you're writing a `kubectl` selector, you want JSONPath. If you're writing an AWS CLI `--query`, you want JMESPath.

Related tools