JSONPath Tester
Test JSONPath expressions against JSON data in real time. View matched results with syntax highlighting. Supports filters, wildcards, and recursive descent. Free, browser-based.
How to Use
- Paste or type your JSON into the JSON Input panel (a sample bookstore dataset is pre-loaded).
- Enter a JSONPath expression in the JSONPath Expression field, or click one of the Example pills.
- Results appear instantly in the Results panel with syntax highlighting.
- Click Copy to copy the matched output to your clipboard.
JSONPath Syntax Reference
$— root element.key— child property (dot notation)[‘key’]— child property (bracket notation)[n]— array element at index n[*]— all array elements or object properties..key— recursive descent — finds key anywhere in the tree[?(@.prop op value)]— filter expression
Common Use Cases
JSONPath is used to extract data from API responses, configure Kubernetes selectors, write assertions in test suites (Jest, Postman), and define routing rules in AWS Step Functions and EventBridge. Knowing how to write JSONPath queries saves significant time when working with nested JSON structures.
FAQ
What is JSONPath?
JSONPath is a query language for JSON, analogous to XPath for XML. It uses a path expression to select nodes from a JSON document. JSONPath is widely used in APIs, testing frameworks, and tools like Kubernetes, AWS Step Functions, and Postman.
What does $ mean in a JSONPath expression?
$ refers to the root element of the JSON document. Every valid JSONPath expression must start with $. On its own, $ selects the entire document. You chain selectors after it, such as $.store.book[0].title.
How do I select all items in an array?
Use the wildcard selector [*] after the array's key. For example, $.store.book[*] returns all book objects in the array. You can further drill into each item: $.store.book[*].author returns every author value.
How do filter expressions work?
Filter expressions use the syntax [?(@.property operator value)]. The @ symbol refers to the current element. For example, $.store.book[?(@.price < 10)] returns all books with a price less than 10. Supported operators include ==, !=, <, >, <=, >=.
What is recursive descent (..) ?
The .. operator recursively searches all descendants of the current node. For example, $..author finds every author field anywhere in the JSON tree, regardless of nesting depth.