How to Test JSONPath Expressions

By Ramanathan Aug 26, 2026 1 min read JSONPath Tester

JSONPath is to JSON what XPath is to XML: a compact way to select values from a document. It's used in API tooling, config, and testing frameworks. Here's the syntax you'll actually use, with examples you can run.

The building blocks

Every expression starts at the root, $, then drills in:

  • $.store.book — child access by name (also $['store']['book'])
  • $.store.book[0] — array index; [-1] counts from the end
  • $.store.book[*] — every element (wildcard)
  • $..author — recursive descent: every author at any depth

Slices and unions

Ranges and multiple selections work inside the brackets:

  • $.book[0:2] — a slice, elements 0 and 1 ([start:end:step])
  • $.book[0,2] — a union, elements 0 and 2

Filters

Filters keep only the elements that match a condition, written with @ for the current element:

$.store.book[?(@.price < 15)].title

That selects the titles of every book cheaper than 15. Filters support ==, !=, <, <=, >, and >=, plus a bare @.isbn test that keeps elements where the field exists and is truthy.

Putting it together

$..book[?(@.price >= 22)].title reads as: find every book anywhere in the document, keep those priced 22 or more, and return their titles.

Related

Working with JSON? See JSON Diff to compare two documents and JSON Formatter to validate one.

Try it

Paste your JSON, type an expression, and watch the matches update live — everything runs in your browser, nothing uploaded.

About the author

Ramanathan · Software Engineer & Solutions Architect

I'm a Software Engineer and Solutions Architect with 20+ years of experience building enterprise applications across BFSI, Healthcare, Retail, Manufacturing, and Industrial Automation. I've spent those two decades living in JSON, tokens, regexes, and config files — so I built the fast, private, no-login developer tools I always wanted to reach for myself.

Last updated: Aug 26, 2026