FormatterHQ

JSONPath Tester

Write a JSONPath query, run it against your own JSON and see every match with a live count. Switch between matched values and their exact paths.

Input JSON
Output JSON
Ready.

How to use the JSONPath Tester

  1. Paste your JSON into the input editor, or click Sample for the classic bookstore document.
  2. Type a query in JSONPath expression, for example $.store.book[?(@.price < 10)].title.
  3. Choose Return: Matched values for the data or Matched paths for the location of each match. With Auto update on, results refresh as you type.
  4. Read the match count in the status bar, then Copy or Download the result array.

A JSONPath tester for building and debugging queries

JSONPath is a small query language for picking values out of JSON, much as XPath does for XML. This JSONPath tester evaluates your expression against your own document as you type and shows every match, so you can refine a query here before placing it in code, a test assertion, an API gateway rule or a monitoring check.

The result is always a JSON array, and the status bar reports how many items matched, for example 2 matches for $.store.book[?(@.price < 10)].title. An empty array with 0 matches means the expression is valid but found nothing.

Syntax reference with results

All results below come from the bookstore sample, which has four books and a bicycle under $.store.

ExpressionMeaningResult
$The root documentThe whole input
$.store.bicycle.colorChild by name (dot notation)"red"
$['store']['bicycle']Child by name (bracket notation)The bicycle object
$.store.book[*].authorWildcard: every element4 authors
$..priceRecursive descent: at any depth5 prices, bicycle included
$.store.book[0,1].titleUnion of indexesFirst two titles
$.store.book[0:2].titleSlice, end excludedFirst two titles
$.store.book[-1:]Negative slice: last elementThe Tolkien book
$..book[?(@.isbn)].titleFilter: property exists2 titles
$..book[?(@.price < 10)].titleFilter: comparison2 titles

Writing filters

Inside [?( )], the symbol @ stands for the element being tested. You can compare with ==, !=, <, <=, > and >=, and combine conditions with && and ||:

$..book[?(@.category=="fiction" && @.price > 10)].author

returns:

[
  "Evelyn Waugh",
  "J. R. R. Tolkien"
]

Filters are run by a restricted expression evaluator rather than by JavaScript's eval, which limits what a pasted query can do in your browser. When an expression cannot be understood, the status bar says so, as in Invalid JSONPath expression: Expected expression after == at character 9.

Values or paths

The Return option decides what each match looks like. Matched values gives you the data itself. Matched paths gives the location of each match in normalized bracket form, which helps when you need to know which elements a filter selected:

["$['store']['book'][0]", "$['store']['book'][2]"]

That is the paths result for $..book[?(@.price < 10)]: the first and third books. The Indent option only affects how the result array is laid out.

Common mistakes

  • Leaving out the root. This tester tolerates store.book[0], but many libraries require the leading $, so always include it.
  • Using = instead of == in a filter.
  • Expecting a single value. Even a query that matches one item returns an array, so your code may need [0].
  • Over-matching with ... $..price also picks up the bicycle price; use $.store.book[*].price if you only want books.
  • Keys with special characters. A key like ship-to must be written $['ship-to'].

Dialects and portability

Queries are evaluated with the jsonpath-plus library, which follows the original JSONPath syntax described by Stefan Goessner and adds a few extensions. JSONPath was standardized in 2024 as RFC 9535, and libraries still differ in edge cases such as filter syntax and how slices behave. Test a query with the library your application will actually use before relying on anything unusual.

To discover the path of a field in the first place, list them all with the JSON navigator. For XML documents, the XPath tester plays the same role. Your JSON and queries are processed in the browser and are not uploaded, unless you use Load URL or Save & Share.

Frequently asked questions

Why does my JSONPath return an array when only one item matches?
The tester always returns results as an array so that zero, one and many matches look the same. Most JSONPath libraries behave this way by default. Take the first element if you expect exactly one match.
How do I filter by a string value in JSONPath?
Compare the property with a quoted string inside a filter, for example $..book[?(@.category=="fiction")]. Use == for equality; a single = is an error.
What is the difference between $.. and $.*?
The wildcard $.* returns only the direct children of the root. Recursive descent $.. searches every level, so $..price finds price keys however deeply they are nested.
Does this JSONPath tester follow RFC 9535?
It uses jsonpath-plus, which implements the widely used Goessner syntax with some extensions. Common expressions such as child access, wildcards, slices and comparison filters work the same way in RFC 9535 implementations, but details can differ between libraries.
Can I get the path of each match instead of its value?
Yes. Set Return to Matched paths and every match is listed as a normalized path like $['store']['book'][0], which you can use to locate or update that element in code.

Last updated September 26, 2026

Related tools

API Tester (REST Client) Send GET, POST, PUT, PATCH and DELETE requests to REST APIs from your browser and inspect status, headers and pretty-printed JSON. JavaScript Tester Run JavaScript online and see console.log, warnings, errors and tables instantly in a safe, sandboxed browser console. Regex Tester Test JavaScript regular expressions live: highlight matches, inspect capture groups and named groups, try flags and preview replacements. Responsive Website Tester Preview any website on phone, tablet, laptop and desktop screen sizes side by side to check your responsive design. XPath Tester Test XPath expressions online against your XML. See matched nodes, attributes, strings, numbers or booleans instantly. String to JSON Converter Convert an escaped JSON string back into formatted JSON. Handles quoted literals, backslash-escaped text and double-encoded JSON. JSON Graph Visualizer Visualize JSON data as a graph of connected nodes. See objects, arrays and values as a diagram of linked boxes with size badges. jq Playground Run jq filters on JSON in your browser with real jq 1.8: live output, -r -c -s -n -S and --arg options, clear errors and a clickable cheat sheet. JSON Cleaner Clean JSON by removing null values, empty strings, empty arrays and empty objects at any depth. Optionally trim whitespace in strings. JSON Decode Online Decode JSON strings online. Convert escaped or encoded JSON text into readable, formatted JSON, similar to json_decode. JSON Deserialize Online Deserialize an escaped JSON payload into formatted JSON, then map it to typed objects in JavaScript, Python, Java or C# safely. JSON Editor Edit JSON online with a live tree preview, instant validation and one-click formatting, repair and minification.