← All tools
// DEVELOPER

JSONPath Tester online

Test JSONPath expressions against JSON data — live results.

JSONPath Tester logo
by
CHUNKY
MUNSTER
JSONPATH TESTER

JSONPath Syntax

How to Use the JSONPath Tester

  1. Paste your JSON payload into the data field.
  2. Type a JSONPath expression starting with $ in the path field.
  3. The result panel updates live — no submit button.
  4. Use [-1] for last-element, [*] for all children, and [0,2] for index lists.

JSONPath is to JSON what XPath is to XML — a tiny, portable expression language for picking values out of a document without writing parser code. This tester implements the subset that covers the vast majority of real-world queries: $ root, .key and ['key'] for child access, [n] integer indices including [-1] for last-element, [*] wildcard over arrays and object values, and [a,b] index lists.

How the JSONPath Tester Works

Both the path expression and the JSON payload are live — every keystroke reparses and re-evaluates so you can iterate on a query without clicking a button. Filters ([?(@.x>1)]) and recursive descent (..) are intentionally not implemented; if you need those, reach for a full library like jsonpath-plus or use jq. Invalid JSON or an unresolved path produces an inline error rather than a silent empty result.

Frequently Asked Questions

Which JSONPath dialect does this implement?

A pragmatic subset: $ root, .key and ['key'] for child access, [n] integer indices, [-1] for last-element, [*] for wildcards over arrays and object values, and [a,b] for index lists. Filters ([?(@.x>1)]) and recursive descent (..) are not implemented — use a server-side JSONPath library for those.

Why use dot notation instead of just JS bracket access?

JSONPath is portable across languages and tools (jq, Postgres jsonb_path_query, gateway routers, log queries) — the same expression works wherever JSONPath is supported. Hand-written JS access only works in JS.

Does $..book work?

No — recursive descent (..) is not part of the subset implemented here. For deep traversal, use a full library like jsonpath-plus on the server or the recursive form in jq.

What does [-1] mean?

The last element of an array. So $.book[-1] returns the last book object regardless of how many entries the array has — handy for log streams or feeds where you only care about the most recent item.

Explore the full suite of DEVELOPER tools and 290+ other free utilities at Chunky Munster.