Skip to content
Marvin's Toolbox.

JSONPath Playground

Try JSONPath queries against your own JSON and see the matches instantly. Every result comes with its normalized path, sample queries help you get started, and the matches are ready to copy or send onward as JSON.

Runs entirely in your browser. Nothing you put in here gets uploaded.

Examples

Matches

Matches
4
  1. Match 1string
    "Sayings of the Century"
    Path
    $['store']['book'][0]['title']
    Pointer
    /store/book/0/title
  2. Match 2string
    "Sword of Honour"
    Path
    $['store']['book'][1]['title']
    Pointer
    /store/book/1/title
  3. Match 3string
    "Moby Dick"
    Path
    $['store']['book'][2]['title']
    Pointer
    /store/book/2/title
  4. Match 4string
    "The Lord of the Rings"
    Path
    $['store']['book'][3]['title']
    Pointer
    /store/book/3/title

Cheat sheet

$the root of the document
@the current item inside a filter
.key or ['key']a child property, dot or bracket form
..keythe property anywhere below, recursive descent
*every child property or element
[*]every element of an array
[2]an element by index, counting from 0
[0,2]several indexes at once
[1:3]a slice from index 1 up to, not including, 3
[-2:]the last two elements
[?(@.price < 10)]keep the elements the filter matches
[?(@.isbn)]keep the elements that have the property
== != < <= > >=comparisons inside a filter
&& || !combine or negate filter conditions
[(@.length-1)]a computed index, here the last element
^step up to the parent of each match

Filter and script expressions run in a restricted parser. Comparisons, arithmetic and property access work, but function calls and anything that reaches outside the document are rejected.

Next steps

Keep going. These tools open with your result loaded in.

Run real jq filters against JSON in your browser. Write a filter, pass options like slurp or raw output, browse a built-in cheat sheet of common filters, and copy the result or send it to another tool.

Paste JSON to explore it as a collapsible, searchable tree, hide the fields you don't need, and see the structure it implies as a badge-annotated schema and a copyable TypeScript interface.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.

Compare two JSON documents by structure and see every added, removed and changed key and value with its exact path. Browse the result as a tree, a filterable change list or a line diff, ignore array order, catch type changes and export the changes as a JSON report.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

About the JSONPath Playground Tool

This tool runs JSONPath queries against any JSON you paste and shows every match while you type. Each match comes with its value, its normalized path and its JSON pointer, so you can find the exact address of a field as easily as its contents.

It comes loaded with the classic bookstore sample and a set of example queries, so you can learn the syntax by clicking through selectors, filters, recursive descent and slices before pointing it at your own data.

What you can do

  • Test a JSONPath expression against your own JSON and see the matches instantly.
  • Find the path to a value in a JSON document, as a normalized path and a JSON pointer.
  • Filter arrays with expressions like [?(@.price < 10)].
  • Learn the syntax from clickable examples and a compact cheat sheet.
  • Copy all matched values or their paths as a JSON array.

How to use the JSONPath Playground

  1. 1Paste the JSON you want to query into the document editor, or keep the bookstore sample.
  2. 2Type a JSONPath expression in the query field, or click an example to load one.
  3. 3Read the matches below. Every match shows its value, its normalized path and its JSON pointer.
  4. 4Copy a single value, path or pointer from a match, or copy all matches as a JSON array.
  5. 5Send the matches to another tool, for example the JSON Inspector, to keep working with them.

Values, paths and pointers

Every match is shown three ways. The value is the piece of data the query selected. The normalized path is the unambiguous bracket form of its address, like $['store']['book'][0]['title'], which works in any JSONPath library. The JSON pointer is the same address in RFC 6901 form, like /store/book/0/title, the format JSON Patch and many APIs expect.

Filters without surprises

Filter and script expressions run in a restricted parser. Comparisons, arithmetic and property access all work, but a query can never call functions or reach outside the document. If a filter fails on some items, for example because a nested property is missing, turn on Ignore filter errors to skip those items instead of stopping.

JSONPath or jq?

JSONPath is a query language: it selects values out of a document, which covers most lookup and extraction jobs with a single short expression. When you need to reshape data, build new objects or chain transformations, use the jq Playground. To explore an unfamiliar document as a tree first, open it in the JSON Inspector.

Credits

Open source does the heavy lifting in this tool. Thank you to:

  • JSONPath Plus

    A JSONPath implementation with the extensions people actually use.

Everything this site builds on is listed on the credits page.

Tools that share a tag with this one.

Format code in JavaScript, TypeScript, JSON, JSON5, HTML, Vue, CSS, SCSS, LESS, Markdown, YAML, GraphQL, XML and SQL. Pick tabs or spaces, set the indent width, and format the input in place with one click.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.

Generate realistic fake data for testing: names, emails, addresses, phone numbers, companies, internet data, dates and more. Tick the fields you need, set how many rows you want and a locale, then copy or download the result as JSON, CSV or plain text.

Drop a HAR export from your browser's network tab and see every request on a waterfall timeline. Inspect status codes, timings, sizes, headers and payloads, filter by type or URL, and spot the slow requests at a glance.

Run real jq filters against JSON in your browser. Write a filter, pass options like slurp or raw output, browse a built-in cheat sheet of common filters, and copy the result or send it to another tool.

Compare two JSON documents by structure and see every added, removed and changed key and value with its exact path. Browse the result as a tree, a filterable change list or a line diff, ignore array order, catch type changes and export the changes as a JSON report.