JSONPath Tester

Test JSONPath expressions against your JSON data. See matching results instantly as you type.

1
2
3
JSON Data
Results

Enter a JSONPath expression to see matching results

$.store.book[*].author
$..price
$.store.book[?(@.price<10)]

JSONPath Tips & Tricks

Master JSONPath expressions to extract exactly the data you need.

1

Start with $ — The Root Element

Every JSONPath expression starts with $ which represents the root of the JSON document. Use $.key to access a top-level key, and chain with dots or brackets for nested access: $.store.book[0].title

2

Use Recursive Descent (..) to Find Keys Anywhere

The .. operator searches all levels of nesting. For example, $..price finds every 'price' field in the document, regardless of depth. This is powerful for exploring unfamiliar JSON structures.

3

Filter Arrays with [?()]

Use filter expressions to query arrays by conditions. For example, $.books[?(@.price < 10)] returns all books cheaper than 10. The @ symbol refers to the current element being evaluated.

4

Common JSONPath Patterns

$..* returns all values. $.store.book[*].author returns all authors. $.store.book[-1:] returns the last book. $.store.book[0,1] returns the first two books. Memorize these patterns for daily use.

JSONPath Features

Test and debug JSONPath queries with ease.

Live Expression Testing

Type your JSONPath expression and see matching results update in real-time.

Full JSONPath Support

Supports standard JSONPath syntax including wildcards, recursive descent, filters, and array slicing.

Result Highlighting

Matching nodes are highlighted so you can verify your expression targets the right data.

What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML. It lets you extract specific values from a JSON document using path expressions. The root element is always referred to as $.

Quick Reference

ExpressionDescription
$Root object
$.storeChild property
$.store.book[0]Array element by index
$.store.book[*]All array elements
$..authorRecursive search (all "author" fields)
$.store.book[*].titleAll titles in book array

Example

Given this JSON:

{
  "users": [
    { "name": "Alice", "age": 30 },
    { "name": "Bob", "age": 25 }
  ]
}

The expression $.users[*].name returns: ["Alice", "Bob"]

JSONPath FAQ

What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML. It lets you extract specific data from JSON documents using path expressions like $.store.book[*].author.

What expressions are supported?

Standard JSONPath expressions including $ (root), . (child), .. (recursive), * (wildcard), [] (subscript), [?()] (filter), and more.

Can I use filters?

Yes, filter expressions are supported for querying elements based on conditions, such as filtering books by price or other properties.

What is the difference between dot notation and bracket notation?

Both access child properties: $.store.book and $['store']['book'] are equivalent. Use bracket notation when keys contain special characters, spaces, or start with numbers.

How is JSONPath different from jq?

JSONPath is a query language for extracting data from JSON, similar to XPath for XML. jq is a more powerful command-line JSON processor with filtering, transformation, and output formatting capabilities. JSONPath focuses purely on data selection.

Can I select values at multiple levels of nesting?

Yes, use the recursive descent operator (..) to search all levels. For example, $..name finds every 'name' field regardless of depth in the document hierarchy.

What are common JSONPath patterns I should know?

Key patterns: $..* (all values), $.items[*].name (all names in items), $.items[-1:] (last item), filter by condition with [?(expression)], and $.items[0:5] (first five items via array slice).

Related Tools

Explore more JSON tools to streamline your workflow.