Test JSONPath expressions against a JSON document and see matched results in real time. Supports wildcards, recursive descent, slices, and filter expressions. Perfect for designing queries for jq, JMESPath, and any JSONPath-based tool.
Enter a JSONPath expression above
JSONPath is a query language for JSON, analogous to XPath for XML. It lets you describe a path through a JSON document with a compact syntax: instead of writing nested loops and conditionals to extract specific values, you write a single path expression.
For example, given an API response with a list of users, $.users[*].email extracts every email address. $.users[?(@.role=="admin")].name extracts the names of admin users. $..price finds every "price" field anywhere in the document, no matter how deeply nested.
JSONPath was originally specified by Stefan Goessner in 2007 and has been implemented widely — in nearly every programming language, in jq (with adjusted syntax), in tools like Postman, and now in the IETF RFC 9535 standardization. Our tester implements the Goessner subset that all libraries agree on.
$ RootThe root of the JSON document. Every JSONPath starts with $.
.name Dot childAccess an object property by name. $.user.name returns the name field of the user object.
['name'] Bracket childAccess by name with brackets — needed for keys with special characters: $['user-name'].
[*] WildcardAll elements of an array or all values of an object. $.users[*] returns every user.
.. Recursive descentMatch at any depth. $..price finds every "price" property anywhere in the tree.
[2] Array index0-based index into an array. $.users[0] returns the first user. Negative indexes count from the end.
[1:3] SliceRange of indexes (like Python slices). $.users[0:3] returns the first three users.
[?()] FilterFilter array elements by predicate. $.users[?(@.age > 18)] returns users older than 18.
[a,b] UnionMultiple keys at once. $['name','email'] returns both the name and email fields.
Here are real-world JSONPath expressions for common tasks:
$.data.items[*].id — extract all item IDs from a paginated response$..error — find every error message anywhere in a nested response$.users[?(@.active==true)].email — emails of all active users$.products[?(@.price > 100 && @.stock > 0)].name — names of in-stock products over $100$.orders[-3:] — the last 3 orders$.users[*].address.city — the city of every user$..book[?(@.isbn)] — every book that has an ISBN field$['key with spaces']['nested key'] — accessing keys with special characters. and ..?$.a.b only finds b directly under a. $..b finds b anywhere in the tree.@ to refer to the current array element. $.users[?(@.age > 18)] iterates over each user and tests whether their age field exceeds 18. Operators supported: ==, !=, <, <=, >, >=.$.. return so many results?$.. alone matches every node in the document — including the root, every object, every array, every value. Almost always you want to chain a property after: $..name finds every "name" field.$['key.with.dots'] instead of $.key.with.dots (which the parser would interpret as nested access).$.users[?(@.role=="admin")] selects users whose role equals admin. There's no direct "find a value" — JSONPath always selects from a position in the tree.[-1] is the last element, [-2] the second-to-last, and so on. For slices, [-3:] means "the last three elements".