🔍 JSONPath Tester

JSONPath Tester Online

Paste any JSON document, write a JSONPath expression, and instantly see every matching result highlighted. Test path queries, filter expressions, and recursive selectors — free, in-browser, no sign-up required.

JSON InputValid JSON
JSONPath Expression
Examples:
Results3 matches
Matched Values
[
  "Clean Code",
  "The Pragmatic Programmer",
  "Refactoring"
]
Matched Paths
  • 1$.store.books[0].title
  • 2$.store.books[1].title
  • 3$.store.books[2].title

What Is a JSONPath Tester and When Should You Use One?

A JSONPath tester is a browser-based tool that lets you evaluate JSONPath expressions against a live JSON document and immediately see which nodes match. Instead of writing a script, running it, and inspecting output, you paste your JSON, type an expression like $.users[?(@.role == "admin")].email and see every matching email address in under a second. This workflow is invaluable when building API integrations, writing Postman tests, configuring AWS Step Functions, or debugging complex nested responses from third-party services.

The tool on this page supports the full JSONPath specification including the $ root operator, . child and .. recursive descent operators, * wildcard, array slices like [0:3], and filter expressions using [?(@.key == value)]. All evaluation happens in your browser — your JSON data never leaves your device.

JSONPath Syntax Reference — Common Expressions

The most frequently used JSONPath patterns are: $ selects the entire root document; $.key selects a top-level property; $.a.b.c navigates nested objects; $.items[0] selects the first element of an array; $.items[*] selects all array elements; $..name finds all name properties anywhere in the document (recursive descent); and $.items[?(@.price < 100)] filters array items by a condition. These patterns cover the vast majority of real-world data extraction tasks. Use the tester above to experiment with your own JSON and immediately see how each expression performs against your actual data structure, saving time compared to trial-and-error in code.

Frequently Asked Questions

What is JSONPath and how does it work?

JSONPath is a query language for JSON documents, analogous to XPath for XML. It uses path expressions to select nodes from a JSON structure. A JSONPath expression starts with $ (the root element) and uses dot notation ($.store.book) or bracket notation ($["store"]["book"]) to navigate through keys, arrays, and nested objects. Operators like * (wildcard), .. (recursive descent), [?(@.price < 10)] (filter), and [0:3] (array slice) make it a powerful tool for extracting data without writing parsing code.

What is the difference between $ and @ in JSONPath?

$ always refers to the root of the JSON document — it is the starting point of every JSONPath expression. @ refers to the current node being processed, and is used exclusively inside filter expressions to reference the item being evaluated. For example, $.books[?(@.price < 20)] uses $ to start at root, navigates to books, then uses @ inside the filter to check each book's price property.

How do I select all values of a key anywhere in a JSON document?

Use the recursive descent operator .. (double dot). For example, $..name selects every "name" property at any depth in the document, regardless of nesting level. This is equivalent to XPath's // operator and is very useful for flattening nested structures or searching for a key whose location you do not know in advance.

Can JSONPath filter results by value or condition?

Yes. JSONPath filter expressions use the syntax [?(<expression>)] where the expression references the current item via @. Examples: $.users[?(@.active == true)] selects users where active is true; $.products[?(@.price < 50)] selects products cheaper than 50; $.items[?(@.tags contains "sale")] matches items with a specific tag. Filters can combine conditions with && (and) and || (or).

What is the difference between JSONPath and JMESPath?

Both are JSON query languages but with different design goals. JSONPath (Stefan Goessner, 2007) is the older standard, widely used in JavaScript libraries, Java (Jayway JsonPath), and testing tools like Postman. Its syntax is modelled on JavaScript property access. JMESPath is newer, used natively by AWS CLI and SDKs, and has a stricter formal specification with a focus on projection and pipe operations. For most browser-based and general-purpose JSON querying, JSONPath is more universally supported and easier to learn.