Open JSON as a searchable tree: click any value for its JSONPath, JavaScript and jq path
Paste JSON or open a file to see it as a table of keys, values and types. Click any value for its JSONPath, JavaScript and jq path, find a key or value, or type a JSONPath such as $..email. Big files open in a background thread, so the page keeps answering.
How to use it
Paste JSON, drop a file or open one: up to 50 MB on a computer, 10 MB on a phone or tablet. NDJSON (one document per line) works too. Open and close values with a click or the arrow keys; Expand all and Collapse all do the whole document. Click a value to see its three paths and copy one, or type in Find or JSONPath to mark every match. Copy matches gives them as a JSON array. JSON Schema makes a schema the whole document passes, to copy or download.
Examples
Every email, wherever it is
JSONPath: $..email
{"data": [{"customer": {"email": "ada@example.com"}}, {"customer": {"email": "grace@example.com"}}], "meta": {"page": 1}}["ada@example.com", "grace@example.com"]
.. looks at every level below, so the path doesn’t need to know where the key sits.
One field from every item
JSONPath: $.items[*].sku
{"items": [{"sku": "A-1", "qty": 2}, {"sku": "B-7", "qty": 1}]}["A-1", "B-7"]
The last item
JSONPath: $.items[-1]
{"items": ["draft", "sent", "paid"]}["paid"]
A negative index counts from the end.
An id longer than a JavaScript number
JSONPath: $.id
{"id": 9007199254740993}[9007199254740993]
JSON.parse would give 9007199254740992. The viewer keeps the digits as written and marks the value “exact”.
A field from each line of NDJSON
JSONPath: $.level
{"level": "info", "msg": "order shipped"}
{"level": "error", "msg": "card declined"}["info", "error"]
Each line is its own document, so $ is each line in turn, as jq reads them.
Items that pass a filter
JSONPath: $.items[?@.qty > 1 && @.sku != 'GIFT'].sku
{"items": [{"sku": "MUG-01", "qty": 2}, {"sku": "TEE-07", "qty": 1}, {"sku": "GIFT", "qty": 3}]}["MUG-01"]
@ is the item being tested. The older form [?(@.qty > 1)], with parentheses, reads the same.
A slice, and a list of names
JSONPath: $.rows[-2:]['id','total']
{"rows": [{"id": 1, "total": 5}, {"id": 2, "total": 8}, {"id": 3, "total": 13}]}[2, 8, 3, 13]
The last two rows, then each row’s id and total, in the order the list names them.
Big files without a freeze
The JSONPath it reads
| Path | Means |
|---|---|
$ | The whole document (each line, for NDJSON) |
$.user.email | Key "email" inside key "user" |
$['first name'] | A key with a space or another special character |
$.items[0] | The first item of "items"; [-1] is the last |
$.items[*].id | "id" of every item |
$..id | Every "id", at any level |
$.user.* | Every value inside "user" |
$.items[0:5] | Items 0 to 4; [::2] every other one, [::-1] all, last first |
$.items[0,2] or $.user['name','email'] | A list: each in the order written |
$.items[?@.price < 10] | Items whose price is under 10 |
$..[?@.status == 'failed' || !@.ok] | Values at any level that failed or have no true ok |
$.users[?match(@.email, '.*@example\.com')] | Users whose whole email fits the pattern; search() finds it anywhere |
$.orders[?count(@.items[*]) > 2] | Orders with more than two items; length(@.name) counts characters |
Sources: RFC 9535: JSONPath
Three paths for one value
Sources: jq manual
Numbers stay as written
Sources: MDN: Number.MAX_SAFE_INTEGER
Questions
- Is my JSON uploaded?
No. Everything runs in your browser, so your JSON stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. When it holds a key or token, the page flags it and recent work keeps only the file’s name. - Can it open NDJSON or JSON Lines?
Yes. When each line holds its own value, the viewer shows one row per line ("line 1", "line 2"…), and JSONPath runs on each line, as jq does. - Why does a number say “exact”?
It has more digits than a JavaScript number holds, so JSON.parse would change it. The viewer shows and copies it as written; in your own code, read it as a string or with a parser that keeps big numbers. - Can it make a JSON Schema from my data?
Yes: JSON Schema in the bar writes a draft 2020-12 schema that every value in the open document passes. Values at the same place are merged (all items of a list, every line of NDJSON); a key is required when every object at its place has it, whole numbers are "integer", and a place holding more than one kind lists them. Copy or download it, then tighten it by hand (formats, limits, enums). - What does it show for colors, dates and links?
The chosen value is also shown as what it stands for: a color (#3366cc, rgb() or hsl()) as a swatch with its hex, RGB and HSL; an ISO 8601 date or a Unix time in seconds or milliseconds as local time, UTC and how long ago; a URL as its scheme, host, port, path, fragment and query parameters; a data: image as the picture. Nothing is fetched, so a picture at a web address is not loaded, and a password in a URL is not shown. - Which JSONPath does it understand?
All of RFC 9535: names (.name and ['name']), indexes ([0], [-1]), wildcards, .. for every level below, slices ([0:5], [::-1]), lists ([0,2]) and filters ([?@.price < 10 && @.stock]), with length(), count(), value(), match() and search(). A path it can't read gets a message saying where and why. - Can I send someone a link to a value?
Yes, to its path: choose a value and copy Link. The link opens this viewer with that JSONPath typed in and holds only the path, not your data, so the person opening it loads the same file to see the matches. To send the data too, use Share. - Can I change the JSON here?
Yes, in files up to 1 MB. Double-click a value, or choose it and press Enter, to change it in its row (Enter saves, Esc cancels); a number stays a number and text stays text. Double-click a key, or press F2, to rename it. For bigger changes, switch to Text: the JSON opens in an editor at the value you chose, the tree follows each time the text reads as JSON, and a mistake is named by its line. - Can it open JSON from a URL?
No. The page fetches nothing from other sites. Open the URL in your browser or with curl, save the response, and open the file here. - How do I find a value when I don’t know its path?
Type part of the key or value in Find: case is ignored, every match is marked, and Enter goes to the next one (Shift+Enter to the one before). Click the value to get its path.