JSON Viewer

JSONPath in five minutes

Find anything in a JSON document with a short expression. Every operator, with examples you can run.

Updated 2026-11-04 · 7 minute read

JSONPath does for JSON what a path does for a file system: it names a place inside a document. One short line pulls every email address out of a file of a hundred megabytes, with no program to write.

All the examples below run in the Search box of this viewer. Set the mode to JSONPath and paste the document first.

The document for the examples

{
  "store": {
    "book": [
      { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 },
      { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 },
      { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "price": 8.99 },
      { "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "price": 22.99 }
    ],
    "bicycle": { "color": "red", "price": 19.95 }
  }
}

The root

Every expression starts with $. It means the whole document.

$

A key

A full stop and the key name step into an object.

$.store.bicycle.color      →  "red"

If the key holds a space, a full stop or a dash, use brackets instead:

$.store['my key']
$["odd.key"]

An item of a list

Brackets with a number take one item. The first item is 0.

$.store.book[0].title      →  "Sayings of the Century"
$.store.book[2].author     →  "Herman Melville"

A negative number counts from the end:

$.store.book[-1].title     →  "The Lord of the Rings"

Everything at this level

A star takes every value of an object or every item of a list.

$.store.book[*].title      →  all four titles
$.store.*                  →  the book list and the bicycle

Anywhere below

Two full stops look at every level below the point, however deep.

$..price                   →  8.95, 12.99, 8.99, 22.99, 19.95
$..author                  →  all four authors

This is the operator that earns its place. You do not need to know the shape of the document to find a key in it.

A part of a list

A slice takes a range. It works like a slice in Python.

$.store.book[0:2]          →  the first two books
$.store.book[1:]           →  every book from the second one
$.store.book[:2]           →  the first two
$.store.book[::2]          →  every second book

Several at once

A list inside the brackets takes more than one:

$.store.book[0,2].title    →  the first and the third title
$['store','warehouse']     →  both keys, if they exist

A test

A filter keeps only the values that pass a test. @ means the value being tested.

$.store.book[?(@.price < 10)]           →  the two cheap books
$.store.book[?(@.category == 'fiction')]
$.store.book[?(@.price > 10 && @.category == 'fiction')]
$.store.book[?(@.isbn)]                 →  books that have an isbn key

The tests you can use are ==, !=, <, <=, >, >=, with && and || between them. A key name on its own means "this key exists".

Real examples

Every email address in a large export

$..email

Every record that failed

$.results[?(@.status != 'ok')]

The name of every user with no email

$.users[?(!@.email)].name

A deeply nested identifier, when you do not know the path

$..customerId

JSONPath against JMESPath and jq

JSONPath jq JMESPath
Made for Finding values Changing and building Finding values
Learn it in Minutes Hours An hour
Runs in a browser Yes Needs a program Yes
Can build new output No Yes Yes

Use JSONPath when you want to find something. Use jq when you want to reshape it.

Why it works on a big file here

Most JSONPath libraries read the whole document into memory as objects first. That costs about ten times the size of the file, so a file of 200 MB needs 2 GB and the tab fails.

This tool runs the expression over its own table of numbers, inside a worker. A query over a file of 120 MB takes about 10 milliseconds, and the page never stops answering.

Things to watch

Try it on your own file. The tool runs in your browser. Nothing is uploaded, and nothing is stored on a server.

Open the JSON Viewer

Read next

How to open a large JSON file without a freeze

Why most viewers die at 20 MB, what to do instead, and how to read a file of several hundred megabytes.

JSON Lines (NDJSON): what it is and when to use it

One JSON value a line. Why logs and data exports use it, and how to read, write and convert it.