Advertisement

JSONPath Tester

Test JSONPath expressions against JSON data with real-time matching and result highlighting.

Results4 matches
[
  "The Lord of the Rings",
  "Moby Dick",
  "JavaScript: The Good Parts",
  "Harry Potter"
]

JSONPath Syntax Quick Reference

$Root object
$.keyChild member
$[*]All elements
$[0]Array index
$[-1]Last element
$[0:3]Array slice
$..keyRecursive descent
$["key"]Bracket notation
$[?(@.x>5)]Filter expression
Advertisement

Related Tools

Advertisement

Frequently Asked Questions

What is JSONPath?
JSONPath is a query language for JSON data, similar to XPath for XML. It allows you to extract specific values, filter arrays, and navigate complex JSON structures using a simple expression syntax. The root element is referenced as $ and child elements are accessed using dot notation ($. store.book) or bracket notation ($["store"]["book"]).
What JSONPath expressions are supported?
This tool supports common JSONPath operations including root access ($), child access ($.key or $["key"]), recursive descent ($..), array indexing ($[0]), array slicing ($[0:3]), wildcard ($.*), and basic filtering ($[?(@.price<10)]). Expressions are evaluated in real-time as you type.
How do I access nested JSON properties?
Use dot notation to access nested properties: $.store.book[0].title accesses the title of the first book in the store. For keys containing special characters or spaces, use bracket notation: $["store"]["my-key"]. You can chain as many levels deep as needed.
How do I filter arrays in JSONPath?
Use filter expressions with the syntax $[?(@.property condition value)]. For example, $.books[?(@.price<20)] returns all books with a price less than 20. The @ symbol refers to the current element being evaluated. You can use comparison operators like <, >, ==, !=, <=, and >=.
What does the recursive descent operator (..) do?
The recursive descent operator (..) searches through all levels of the JSON structure. For example, $..title finds all "title" properties regardless of their depth in the hierarchy. This is useful when you know the key name but not its exact location in the structure.
Is my JSON data sent to a server?
No. All JSONPath evaluation happens entirely in your browser using JavaScript. Your JSON data never leaves your device, ensuring complete privacy for sensitive data like API responses, configuration files, or any other JSON content you are testing.

How to Use the JSONPath Tester

JSONPath is an indispensable query language for extracting specific values from complex JSON documents. Whether you are debugging API responses, writing data transformation scripts, or configuring tools that accept JSONPath expressions, our free online JSONPath tester helps you build and verify expressions with instant feedback.

Step 1: Paste your JSON data. Enter or paste your JSON document into the left panel. The tool validates the JSON and shows syntax errors immediately. You can use any valid JSON: objects, arrays, nested structures, or primitive values. The JSON is parsed and formatted automatically for readability.

Step 2: Write a JSONPath expression. Enter your JSONPath expression in the query field. Start with $ to reference the root element, then use dot notation or bracket notation to navigate the structure. The tool evaluates your expression in real-time as you type, highlighting matched nodes in the JSON view.

Step 3: Review matched results. The results panel shows all values matched by your JSONPath expression, formatted as JSON. You can see exactly which nodes were selected and copy the results for use in your code or configuration files.

JSONPath Syntax Reference

The JSONPath syntax provides a powerful yet intuitive way to query JSON data. The root object is always referenced as $. Child members are accessed with dot notation ($.store) or bracket notation ($["store"]). Array elements use zero-based indexing ($[0]), and you can slice arrays with the colon operator ($[0:3] for the first three elements). The wildcard operator (*) matches all members of an object or all elements of an array, while the recursive descent operator (..) searches through all levels.

Filter expressions use the syntax $[?(@.property operator value)] where @ references the current element. Common operators include equality (==), inequality (!=), less than (<), greater than (>), and existence checks. These filters are essential for extracting specific items from arrays based on their properties.

Common JSONPath Use Cases

API response debugging. When working with REST APIs, you often receive deeply nested JSON responses. JSONPath lets you quickly extract the specific fields you need without manually navigating through layers of objects and arrays. This is especially useful when prototyping API integrations or writing data mapping configurations.

Configuration and tooling. Many tools and platforms accept JSONPath expressions for data extraction. AWS Step Functions, Azure Logic Apps, Kubernetes custom resource definitions, and testing frameworks like Postman all support JSONPath for extracting values from JSON payloads. Testing your expressions here before using them in production saves debugging time.

Data transformation scripts. When writing ETL pipelines or data transformation code, JSONPath expressions help you specify which parts of a JSON document to extract and transform. Our tester lets you prototype these expressions interactively before writing the code.

Learning and teaching. If you are learning JSONPath syntax, this interactive tester provides instant visual feedback. Try the example expressions to understand how each operator works, then experiment with your own data and queries to build confidence with the syntax.

Advertisement