How to Test JSONPath Expressions
JSONPath
When to Use JSONPath
Use JSONPath to extract nested fields from API responses, filter array items, and debug complex JSON without writing code. Paste a JSON document and an expression to see matched values instantly.
Real-World Examples
$.store.book[*].author — all book authors in a nested catalog
$..price — recursive lookup of every price field
$.items[?(@.status == "active")] — filter array items by a property
Common Mistakes
- Forgetting the root prefix
$— most expressions start at the document root - Using SQL-style
WHEREinstead of JSONPath filter syntax[?(@.field)] - Expecting PCRE regex features — JSONPath filters use limited comparison operators
Developer Tips
- JavaScript:
JSONPath-Plusorjsonpathnpm packages - Start with
$..keyNameto find where a field appears, then narrow the path - Validate JSON syntax first if the document fails to parse
Frequently asked questions
Which JSONPath syntax is supported?
This tool uses JSONPath-Plus, which supports standard JSONPath expressions including filters, recursive descent, and array slices.
What does @ mean in a filter?
Inside [?(...)] filters, @ refers to the current item being evaluated in the array or subtree.
Why does my expression return an empty array?
The path may not exist, the filter condition may not match, or property names are case-sensitive. Check spelling and nesting level.