Developer tool

JSONPath Query Tool

Paste JSON and a JSONPath expression to extract matching values.

Runs in your browser. No upload.

Values are processed locally in this browser.

Result

—

About this tool

JSONPath Query Tool made simple.

Supports root, dot/bracket properties, array indexes, wildcards and simple equality filters such as $[?(@.active == true)]. It does not execute JavaScript or load remote data.

Guide

Using JSONPath Query Tool

The JSONPath Query Tool pulls values out of a block of JSON. You paste the JSON, type a path such as $.users[*].name, and press Calculate to see what matches, formatted with two-space indentation. It handles a small, safe subset of JSONPath: property names, array positions, wildcards and simple equality filters. It never runs code from your data and never loads anything from the web.

How to use it

  1. Paste your JSON into the JSON data box. It must be valid, with double-quoted keys and no trailing commas, or the tool reports a JSON error.
  2. Type a path that starts with $, the root of the data. The box starts with $.users[*].name. Paths can be up to 500 characters.
  3. Build the path from dots and brackets: .name for a property, [0] for an array position, [*] or .* for every child, ["key"] for awkward names, and a filter like [?(@.active == true)].
  4. Press Calculate to see the result. Clear empties the form. Copy result puts the text on your clipboard.

Worked examples

Every title in a list

You enter
Json
{"shop":{"books":[{"title":"A","price":8},{"title":"B","price":12},{"title":"C","price":8}]}}
Path
$.shop.books[*].title
You get
Value
[ "A", "B", "C" ]

The [*] visits each book, and .title takes the title from each. Several matches come back as a list.

Run through the tool’s own code.

Keep only items that match a value

You enter
Json
{"shop":{"books":[{"title":"A","price":8},{"title":"B","price":12},{"title":"C","price":8}]}}
Path
$.shop.books[?(@.price == 8)].title
You get
Value
[ "A", "C" ]

The filter keeps the books whose price is exactly 8. Then .title takes their titles. Comparing 8 with the text "8" would not match, since the types must agree.

Run through the tool’s own code.

A comparison the tool does not support

You enter
Json
{"shop":{"books":[{"title":"A","price":8},{"title":"B","price":12}]}}
Path
$.shop.books[?(@.price > 10)].title
You get
Value
Supported brackets: [0], ["key"], [*] and simple equality filters.

Only == and != are accepted inside a filter. A greater-than test is refused with this message, and nothing is evaluated.

Run through the tool’s own code.

When it helps

  • Pull one field out of a long API response while debugging.
  • Check that a path you plan to use in code selects the values you expect.
  • List every value of one key across an array of records.
  • Filter records by a flag, such as active equal to true, to count or inspect them.

Limits to keep in mind

  • Only a subset is supported. Recursive descent (..), slices like [0:2], unions like [0,1], negative indexes and comparisons such as > or < are not available.
  • Filters accept only @.key == value or @.key != value, where the value is valid JSON such as true, 3, null or "text". Single-quoted text is not valid there.
  • If exactly one value matches, it is shown on its own and not inside a list. If nothing matches, the result reads No matches.
  • The query stops with a message if it would return more than 10,000 values, and the path itself cannot be longer than 500 characters.

Tips

  • Start with $ alone to confirm the JSON parsed, then add one segment at a time and watch the result narrow.
  • Use ["key"] for names with spaces or other odd characters, such as $.shop["first name"].
  • Remember that one match is not wrapped in a list when you copy a result into code that expects an array.

Sources

Common questions

About JSONPath Query Tool.

What is JSONPath?

It is a query language for JSON, similar in spirit to XPath for XML. A path starting with $ walks through objects and arrays to select values. A full standard exists as RFC 9535, and this tool covers a small part of it.

Which JSONPath features does this tool support?

The root $, dot and bracket property names, array positions like [0], the wildcard [*] or .*, and filters of the form [?(@.key == value)] or != value. It does not run scripts and it does not fetch data from the internet.

Why does my path with .. give an error?

The two-dot form selects values at any depth, which the tool does not implement. It stops with a message about recursive descent. Write the full path step by step instead, for example $.store.users[*].name.

Why can I not filter by price greater than 10?

The filter engine only compares for equality or inequality. A greater-than or less-than test is rejected. A workaround is to extract the values with [*] and compare them in your own code or another tool.

Why do I get a value instead of a list?

When a path matches exactly one value, the tool shows that value alone. When it matches several, it shows a list. When nothing matches, it says No matches. Keep this in mind when comparing results from different paths.

Why does the JSON fail to load?

The text must be strict JSON. Keys need double quotes, strings need double quotes, trailing commas are not allowed and comments are not allowed. The error message from the parser usually names the position where it stopped.

Is my JSON sent anywhere?

No. The query runs in your browser and the data is not uploaded. The tool does not execute JavaScript from your data. The page forgets the content when you reload it, so copy any result you want to keep.

How do I use JSONPath query tool?

Paste JSON and a JSONPath expression to extract matching values.

Is my data uploaded to a server?

No. This tool runs locally in your browser. Your input is not uploaded.