🔒 All processing happens in your browser. No data is sent to any server.
FREE

JSONPath Tester

← All Tools
JSONPath Expression
Examples
JSON Input
Results

What is JSONPath Tester?

JSONPath Tester evaluates JSONPath expressions against JSON data. Paste JSON in the top panel, enter a JSONPath query (e.g., $.store.book[*].author or $..price), and see the matching elements highlighted and listed. Supports both Goessner JSONPath notation and RFC 9535 (the 2024 IETF standard), with bracket notation, filter expressions, recursive descent (..), wildcards (*), and slice operators.

JSONPath is a query language for JSON data, analogous to XPath for XML. Created by Stefan Goessner in 2007. Syntax: $ is the root. . (dot) is child access. [] is bracket notation. * is wildcard (all children). .. is recursive descent (search all levels). @ refers to the current element in a filter expression. [?(...)] is a filter. Slice: [start:end:step]. Example: $.store.book[?(@.price < 10)].title returns titles of cheap books.

RFC 9535 (JSONPath, 2024) is the official IETF standardization of JSONPath, resolving the many ambiguities in the original Goessner spec. Key additions: standardized filter expression semantics, normalized path output, segment types (child vs descendant), and a formal grammar. Most tools and libraries pre-date RFC 9535 and implement Goessner JSONPath — check which version your tool supports when results differ.

How to Use

  1. Paste your JSON data into the top panel.
  2. Enter a JSONPath expression in the query field (start with $).
  3. Results appear instantly — matching values are highlighted in the JSON tree.
  4. Switch between 'Values' and 'Paths' output mode to see matched paths.
  5. Use the examples dropdown to try common JSONPath patterns.

Examples

Get all book authors

Result: $.store.book[*].author → ["Nigel Rees", "Evelyn Waugh", ...]

Filter by price

Result: $.store.book[?(@.price < 10)].title → books costing less than $10

Recursive search

Result: $..author → all author values at any depth in the JSON

Frequently Asked Questions

What is the difference between $.foo and $..foo in JSONPath?

$.foo accesses the 'foo' property directly on the root object — one level deep. This is the child operator. $..foo is the recursive descent operator — it searches at every level of the JSON structure for a 'foo' property. Example: if 'author' appears in nested objects at different depths, $.author finds it only at root, $..author finds it everywhere. The double-dot (..) is useful for extracting a specific key from deeply nested or variably structured JSON.

How do I filter JSON array elements with JSONPath?

Filter expressions use [?(...)]: [?(@.price < 10)] — elements where price < 10. [?(@.category == 'fiction')] — elements where category equals 'fiction'. [?(@.isbn)] — elements that have an isbn property (existence check). [?(@.price > 5 && @.price < 20)] — price between 5 and 20 (in supporting implementations). @ refers to the current element. Comparison operators: ==, !=, <, >, <=, >=. The exact set of supported operators varies by implementation — RFC 9535 standardizes the set.

What is the difference between dot notation and bracket notation in JSONPath?

Dot notation: $.store.book.title — cleaner for simple keys. Bracket notation: $['store']['book']['title'] — required for keys with spaces, special characters, or that start with numbers. For array access: $.list[0] (dot notation for index) or $['list'][0]. Wildcards: $.* (all children of root) == $['*'] is ambiguous — prefer $.* for children, $..* for all descendants. Bracket notation is more explicit and works in all edge cases; dot notation is more readable for simple paths.

What tools support JSONPath queries?

JavaScript: jsonpath-plus (comprehensive, RFC 9535 compatible), jsonpath (Goessner). Python: jsonpath-ng (RFC 9535), jsonpath-rw (Goessner). Java: Jayway JsonPath (widely used, REST-assured uses it for API testing). Go: gjson (fast), github.com/PaesslerAG/jsonpath. Database support: PostgreSQL uses jsonpath (its own syntax for jsonb columns). MySQL: JSON_EXTRACT(doc, '$.field'). jq (command-line): has its own query language similar to JSONPath. Postman and most API testing tools support JSONPath for assertions.

How does JSONPath compare to jq?

JSONPath is a standardized query language for navigating JSON structures — read-only queries, returns values or paths. jq is a powerful command-line JSON processor with its own language that can both query and transform JSON: filter, map, reduce, add, delete fields. jq is much more powerful for data transformation but has a steeper learning curve. For simple value extraction: JSONPath and jq are similar. For reshaping JSON (combining arrays, computing aggregates, restructuring objects): jq is the right tool. JSONPath is better for in-app querying where you need a standard, embeddable library.

Related Tools