Command Palette

Search for a command to run...

JS

JSONPath Tester

Test JSONPath expressions against any JSON and see the matched values and their paths instantly. Supports wildcards, recursive descent, slices, and filters. 100% client-side.

What is a JSONPath tester?

A JSONPath tester evaluates a JSONPath expression against a JSON document and returns every value the expression selects, along with the exact path to each match. JSONPath is a query language for JSON, the way XPath is a query language for XML: you write a short path such as $.store.book[*].author and get back the list of matching values without writing any code. This tool parses your JSON, runs the expression, and shows both the results and the normalized path of each one.

The point of a tester is feedback. When a JSONPath expression returns nothing, or returns more than you expected, the problem is almost always a small syntax detail: a missing wildcard, the wrong bracket style, or a filter that compares a string to a number. Running the query live against real data, and seeing which nodes it touches, turns that guesswork into a two second check. It is the same reason developers keep a regex tester open next to their editor.

Everything runs in your browser. The JSON is parsed with the built-in JSON parser and the expression is evaluated by a small interpreter written in JavaScript, so nothing is uploaded, logged, or stored. That matters because JSONPath work usually happens against API responses and config files that carry tokens, IDs, or customer records, and this tool keeps that payload on your own machine and keeps working offline once the page has loaded.

JSONPath is a convention with several implementations rather than a single specification, and they disagree at the edges. Filter syntax is the least portable part, so an expression that works in one library may need adjusting in another. Recursive descent is the expensive operation: it walks every node in the document, so on a large file a query beginning with two dots is noticeably slower than an explicit path.

To try it as a JSONPath online evaluator, click Load Sample, replace the expression with $.store.book[?(@.price < 10)].title and click Evaluate. Values mode returns ["Sayings of the Century", "Moby Dick"] with the pane marked 2 results. Switch Output to Paths and click Evaluate again, and the same query returns $.store.book[0].title and $.store.book[2].title, which tells you the filter skipped the books at index 1 and 3. Change the expression to $..price and you get five numbers, because recursive descent also reaches the bicycle.

How to use the JSONPath tester?

  1. Paste your JSON

    Paste an object or array into the JSON box, or click Load Sample for the bookstore document. The input must be valid JSON; a parse error is shown with your browser's own message, which usually names the position so you can fix it.

  2. Write a JSONPath expression

    Enter a path such as $.store.book[*].title or $..price. Start from $ for the root, use dots or brackets for children, and add filters like [?(@.price < 10)] to select by value.

  3. Read the matches

    Click Evaluate to run the expression; the Matches pane lists every matched value and shows the result count. Switch Output to Paths or Entries and click Evaluate again to see where each result came from.

  4. Copy the result

    Copy the matched values, the list of paths, or the full path-and-value entries as JSON to paste into your code, tests, or documentation.

Key Features

  • Full path syntax

    Root, child, recursive descent (..), wildcard (*), array index including negative index, unions, and Python-style slices are all supported so most published JSONPath examples run unchanged.

  • Filter expressions

    Select nodes by value with filters such as [?(@.price < 10 && @.category == "fiction")]. Comparison operators, existence checks, and && / || combinations are evaluated per element.

  • Values, paths, or entries

    See the matched values, the normalized path of every match, or both together as entries. The path output is handy for building the expression you need.

  • Clear error messages

    Invalid JSON and malformed expressions are reported separately with a specific message, so you know whether to fix the data or the query rather than staring at an empty result.

Frequently Asked Questions

JSONPath is a query language for JSON, modeled on XPath for XML. An expression like $.store.book[0].title describes a path through the document, and evaluating it returns the value or values at that path. It is widely used in API testing tools, gateways, and configuration systems to extract or match parts of a JSON payload.

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!

jsonpath testerjsonpath evaluatorjson path onlinetest jsonpathjsonpath queryjsonpath filterjsonpath expressionquery jsonjsonpath onlinejsonpath online evaluatorjsonpath evaluator onlinejsonpath filter examples