DevLab
{}
JSONintermediate

JSONPath Tester

test JSONPath expressions against JSON data in real time

By DevLab Editorial TeamLast updated

Test JSONPath expressions against a JSON document and see matching values instantly. Supports dot notation (.key), bracket notation ([0]), and wildcards (.* and [*]). Enter a path like $.store.books[0].title and the matched value appears immediately. All evaluation runs in the browser.

Try it now — free, instant, no signup

What is JSONPath Tester?

JSONPath is a query language for JSON documents, analogous to XPath for XML. A JSONPath expression starts with $ (the root document), followed by a chain of selectors: .key for property access, [n] for array indexing, .* or [*] for wildcards that match all properties or all array elements. The result is a list of values extracted from the JSON tree that match the path.

JSONPath is used across a wide range of tools and frameworks: jq, Kubernetes policy engines (OPA, Kyverno), AWS Step Functions, Postman test assertions, Elastic Search queries, and data transformation libraries in Python, Java, and JavaScript. Knowing how to write and debug JSONPath expressions is increasingly important as JSON APIs proliferate.

This tester implements the core JSONPath subset: root ($), property access (.key), array indexing ([n] including negative indices for last element), wildcards (.* and [*]), and basic recursive path handling. Filter expressions ([?(@.price < 10)]) are not yet supported as their syntax varies significantly between implementations. RFC 9535, published February 2024, is now the formal IETF standard for JSONPath.

When to use JSONPath Tester

Verify a JSONPath expression before embedding it in a Postman test script, Kubernetes policy rule, or AWS Step Functions state definition.
Extract specific nested fields from a large API response JSON without writing a JavaScript traversal function.
Debug why a JSONPath expression in an OPA policy or data pipeline is returning no matches by testing it against a representative document.

Expert Notes

The most common JSONPath mistake is using $..key (recursive descent) expecting it to work like $.*.key — recursive descent searches all levels of nesting, which can return unexpected results from deeply nested documents. Always test recursive paths against a representative sample before deploying them in a policy or pipeline rule.

DevLab's Take

Essential for anyone writing Postman tests, OPA policies, or Kubernetes admission controllers — the visual feedback of seeing exactly which values a path matches saves significant trial-and-error against a live system.

Frequently Asked Questions

What is the difference between $.store.books and $.store.books[*]?
$.store.books returns the entire books array as a single match — one result which is the array itself. $.store.books[*] applies the wildcard to the array, returning each element as a separate match. This distinction matters when you need to iterate over array elements versus when you want the array itself as a single value.
How does the wildcard .* differ from [*]?
.* (dot-wildcard) returns all property values of an object. [*] (bracket-wildcard) returns all elements of an array. In practice: if the target is an array, use [*]; if it is an object, use .*. Most JSONPath implementations treat [*] as all children regardless of whether the parent is an array or object.
Does it support filter expressions like [?(@.price > 10)]?
Not currently. Filter expressions are part of the JSONPath specification but their syntax varies significantly between implementations. This tool implements the core path navigation subset that works identically across implementations. For filter-based queries, use jq online or jsonpath.com.
Is JSONPath standardized?
Yes, as of 2024. RFC 9535 (published February 2024) defines JSONPath as a formal IETF standard for the first time. Prior to that, implementations were based on Stefan Goessner's 2007 blog post, leading to inconsistencies between jq, JsonPath for Java, jsonpath-plus, and others. New tools implementing RFC 9535 will be interoperable; older implementations may differ on edge cases.
How does JSONPath compare to jq?
JSONPath is a query language focused on selecting values from a JSON document. jq is a full transformation language that can select, reshape, filter, aggregate, and compute. For reading a value out of a document, JSONPath is simpler and more portable. For complex transformations — mapping, reducing, conditional logic — jq is significantly more powerful. If you just need to extract a field or array of values, JSONPath is sufficient; if you need to reshape or compute, use jq.

Related Tools

Learn more