JSON Path Tester ⚡

Test JSONPath expressions against JSON data instantly. Supports wildcards and complex queries.

JSON Input
JSONPath Expression
Evaluation Result
Invalid JSON
1

        

What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML. It allows you to select and extract data from a JSON document using a concise syntax. It is widely used in APIs, configuration files, and data processing pipelines to filter and retrieve specific values from complex, nested JSON structures.

Basic JSONPath Syntax

JSONPath expressions always refer to a JSON structure in the same way as XPath expressions are used in combination with an XML document. The "root member object" in JSONPath is always referred to as $ regardless if it is an object or array.

  • $ : The root object or array.
  • .property : Selects the specified property in a parent object.
  • ['property'] : Bracket notation, useful when properties have special characters or spaces.
  • [n] : Selects the n-th element from an array.

Advanced Operators and Wildcards

JSONPath supports several operators that make queries extremely powerful, allowing for deep scans and filtering:

Operator Description Example
.. Deep scan. Available anywhere a name is required. $..author (Finds all authors anywhere in the document)
* Wildcard. All objects/elements regardless of their names. $.store.book[*] (All books in the store)
[start:end:step] Array slice operator borrowed from ES4/Python. $..book[0:2] (The first two books)
[?()] Filter expression. Evaluates to a boolean value. $..book[?(@.price < 10)] (Books cheaper than 10)