JSON Input
Query Result

JSONPath Syntax Reference

Basic Selectors

$ Root element
.property Dot notation property
['property'] Bracket notation property
[index] Array index

Array Operations

[*] All array elements
[1,2,3] Multiple indices
[start:end] Array slice
[0:3] First 3 elements

Recursive Descent

.. Recursive descent
$..name All "name" anywhere
$..price All "price" fields
$..[0] First element of all arrays

Common Examples

$.store.book[*] All books
$.store.book[0].title First book title
$..book[*].author All authors
$.store.book[-1:] Last book

Key Features

🔍 Deep Query

Navigate deeply nested JSON structures with simple expressions.

⚡ Instant Results

Real-time query execution as you type with automatic formatting.

📝 Full Syntax

Supports dot notation, bracket notation, wildcards, and slices.

🔒 Privacy First

All processing happens locally in your browser. Data never leaves.

Frequently Asked Questions

Getting Started

What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML. It allows you to extract and filter data from JSON documents using a simple, expressive syntax. It's widely used in API testing, data extraction, and configuration management.

How do I use this tool?

Paste your JSON into the left panel, enter a JSONPath expression in the input field at the top, and click "Query". The matching results will appear in the right panel. Use the example links below the input to try common patterns.

Does this tool store my JSON data?

No. All processing happens entirely in your browser using JavaScript. Your data is never sent to any server, stored in a database, or shared with anyone. It's completely private.

Basic Syntax

How do I select nested properties?

Use dot notation: $.store.book[0].title or bracket notation: $['store']['book'][0]['title']. Both access the same nested value. Dot notation is cleaner for simple keys, while bracket notation supports keys with special characters.

What does the $ symbol mean?

The $ symbol represents the root element of your JSON document. All JSONPath expressions start with $ to indicate you're querying from the top level of the JSON structure.

Can I use negative indices?

Yes, negative indices count from the end of an array. [-1] selects the last element, [-2] the second-to-last, and so on. For example, $.store.book[-1] gets the last book.

Array Operations

Can I select all items in an array?

Yes! Use the wildcard [*] to select all elements. For example, $.store.book[*].title gets all book titles. You can also use $.store.book[*] to get the complete array of books.

How do array slices work?

Array slices use the syntax [start:end]. For example: [0:3] gets elements 0, 1, 2 (up to but not including 3). [2:] gets elements from index 2 to the end. [:3] gets the first 3 elements.

Can I select multiple specific indices?

Yes! Use comma-separated indices: [0,2,4] selects the first, third, and fifth elements. You can also mix: [0,2:4,7] selects index 0, indices 2-3, and index 7.

Examples

Example: Extract user names

JSON:

{"users":[{"name":"John","age":30},{"name":"Jane","age":25}]}

JSONPath: $.users[*].name

Result: ["John", "Jane"]

Example: Find all prices

JSONPath: $..price

What it does: Recursively searches through all levels of the JSON and returns every field named "price", regardless of where it appears in the structure.

Result: [8.95, 12.99, 8.99, 22.99, 19.95]

Example: Get first 3 items

JSONPath: $.store.book[0:3]

What it does: Returns books at indices 0, 1, and 2 (the first 3 books).

Example: Get last item

JSONPath: $.store.book[-1:]

What it does: Uses negative index to select only the last book in the array.

Advanced Features

What is recursive descent?

The .. operator performs a deep search through all nested levels of the JSON. $..price finds all fields named "price" anywhere in the structure, regardless of how deeply nested they are.

When should I use bracket notation?

Use bracket notation ['property'] when: 1) The key contains special characters or spaces, 2) The key starts with a number, 3) The key is a reserved word, 4) You're using a variable as the key.

Can JSONPath modify JSON?

Standard JSONPath is for querying only - it extracts data but doesn't modify it. Some implementations support updates, but this tool focuses on read-only queries for extracting and filtering data.

Common Use Cases

API Response Testing

Use JSONPath to validate API responses by extracting specific fields. For example, check that $.status equals "success" or verify $.data.items[0].id exists.

Data Transformation

Extract specific fields from complex JSON to create simpler structures. For example, get all email addresses with $..email or collect all product names with $.products[*].name.

Configuration Management

JSONPath is used in tools like Kubernetes and Prometheus to select specific values from configuration files. For example, $.spec.containers[0].image to get a Docker image name.