DevBolt
Processed in your browser. Your data never leaves your device.

How do I test JSONPath expressions online?

Paste your JSON data, type a JSONPath expression like $.store.book[*].title, and see matching results highlighted in real time. The tool supports dot notation, bracket notation, wildcards, array slicing, and filter expressions. Everything runs in your browser — your data never leaves your device.

Extract nested field
Input
Path: $.store.book[0].title
Data: {"store":{"book":[{"title":"Moby Dick"}]}}
Output
"Moby Dick"
← Back to tools

JSON Path Tester

Test JSONPath expressions against your JSON data with real-time evaluation. Perfect for building API queries, data extraction, and debugging JSON structures.

About JSONPath

JSONPath is a query language for JSON, similar to XPath for XML. It lets you extract specific values from complex JSON structures using path expressions.

Common syntax:
  • $ — root object
  • .key — child property
  • [*] — all array elements
  • [0], [0:3] — array index / slice
  • .. — recursive descent (search all levels)
  • [?(@.price < 50)] — filter expression

JSONPath is commonly used in REST API testing, data pipelines, and configuration management to extract or validate specific fields from JSON payloads.

Everything runs in your browser — no data is sent over the network.

Tips & Best Practices

Pro Tip

Use recursive descent (..) to find deeply nested values

$.store..price finds all price fields regardless of depth — you don't need to know the exact path. This is invaluable when exploring unfamiliar API responses. Combine with filters: $..book[?(@.price < 10)] finds all books under $10 anywhere in the document.

Common Pitfall

JSONPath implementations vary significantly

There is no single JSONPath standard (RFC 9535 was published in 2024 but adoption is incomplete). Jayway (Java), Goessner (original), and jsonpath-plus (JS) handle filter expressions, array slicing, and script expressions differently. Always test your JSONPath queries against the specific library your production code uses.

Real-World Example

Array slicing follows Python conventions

$.items[0:3] returns the first 3 items (indices 0, 1, 2). $.items[-1:] returns the last item. $.items[::2] returns every other item. The syntax is [start:end:step]. These operations are much more efficient than fetching all items and filtering in application code when your JSONPath engine supports server-side evaluation.

Security Note

Filter expressions can be injection vectors

JSONPath filter expressions like [?(@.name == 'value')] can be vulnerable to injection if the value comes from user input without sanitization. An attacker could inject ')]|| true ||[?(1==1' to bypass filters. Always parameterize or sanitize user input in JSONPath queries, just like SQL.

Frequently Asked Questions

What is JSONPath and how do I use it?
JSONPath is a query language for extracting values from JSON documents, similar to XPath for XML. The root element is $, dot notation traverses objects ($.store.book), brackets access arrays ($[0]), wildcards select all children ($.store.*), and recursive descent (..) searches all levels. Filter expressions like $..book[?(@.price<10)] select elements matching conditions. DevBolt's JSONPath Tester lets you paste JSON, write expressions, and see results highlighted in real time.
What is the difference between dot notation and bracket notation in JSONPath?
Dot notation uses periods to traverse: $.store.book.title. It is concise but only works with valid JavaScript identifiers. Bracket notation uses quoted strings: $['store']['book']['title']. It supports any property name including spaces and special characters. Bracket notation is required for array index access ($[0]) and filter expressions. Most developers use dot notation for simple paths and brackets when property names require it.
How do I filter JSON arrays using JSONPath?
Filter expressions use [?(@.condition)] syntax. The @ symbol refers to the current element. Operators include comparison (==, !=, <, >), existence checks (@.property), and logical operators (&& for AND, || for OR). Examples: $..book[?(@.price<10)] selects cheap books, $..product[?(@.inStock && @.price<50)] selects affordable in-stock products. Test expressions in DevBolt's tester to verify matches before using them in production code.

Related Inspect Tools