JSON Viewer
Explore JSON as a collapsible tree: search keys and values, copy any value's path, and open large files without freezing the page.
Shows JSON as a tree you can open level by level, search, and point at: select any value to copy its path in the form your code needs, or the value itself. An array of objects can also be read as a table.
It is built for files too large for an ordinary viewer — API exports, logs, database dumps — up to 100 MB and 10 million values. The file is read in a background worker that keeps it while the page asks only for the rows in view, so scrolling and searching stay smooth and the page never freezes. Everything runs in your browser; nothing you open or paste is uploaded.
How to use it
- Open file, drop a file on the tool, paste JSON into the empty box, or load the Example. Text whose lines each hold one value (JSON Lines, NDJSON) opens as a list of its lines, and says so.
- Tree — opens two levels deep, or one when the document holds more than 10,000 values. Click a row, or use the keyboard: ↑ and ↓ move, → opens a container and ← closes it or steps back to its parent, Enter selects. Expand all and Collapse all work on any size. Strings longer than 200 characters are cut in their row; Show all selects them to read in full.
- Table — the selected array of objects, or the one the selected value sits in, as rows and columns. Columns come from the keys of the first 1,000 items; nested values show their size, such as
[3]. Click a cell to select its value. - Text — the JSON in an editor, up to 5 MB; the tree follows your edits. A larger file is shown only as a tree and table, so the page never holds it as text.
- Search — finds keys and values as you type and opens the tree to the first match; Enter and Shift+Enter step through the rest. Case is ignored unless the search holds a capital letter. A search starting with
$(JSONPath) ordata.(JavaScript) goes straight to that value; one that does not read as a path, such as$5, is searched for as text, and the status line says why. A JSONPath query that can select several values is for the JSONPath Tester. - Selected value — its path as a breadcrumb (click a step to go back up), its size and number of keys or items. Copy path copies it as JSONPath; the arrow beside it offers JavaScript and jq, and the format you pick stays the default. Copy value copies a string's text without its quotes, and anything else as JSON indented by two spaces — or as written when larger than 5 MB. On a phone, where it sits under the tree, a bar at the foot of the screen holds the path and its copy.
An error names its line and column, worded as the JSON Formatter words it; trailing commas, comments and single quotes are named as such.
Three ways to write a path
A path is the way from the top of the document to one value. JSONPath's normalized form (RFC 9535) quotes every key, so it is exact whatever the key holds. JavaScript writes a dot before a key that is a valid identifier and brackets otherwise, starting from data, the name the parsed JSON usually has in code. jq writes the same dots, and brackets for any other key.
Examples
A plain key
- JSON
{ "customer": { "name": "Ann Lee" }, "order-items": [ { "sku": "B-102", "it's a gift": true } ] }- JSONPath
- $['customer']['name']
- JavaScript
- data.customer.name
- jq
- .customer.name
Selecting "Ann Lee" gives these three paths.
Keys with a hyphen, a space and a quote
- JSONPath
- $['order-items'][0]['it\'s a gift']
- JavaScript
- data["order-items"][0]["it's a gift"]
- jq
- .["order-items"][0]["it's a gift"]
Selecting true in the same document: neither key is an identifier, so JavaScript and jq bracket both, and JSONPath escapes the apostrophe.
Frequently asked questions
JavaScript stores numbers as 64-bit floating point, exact only up to 9,007,199,254,740,991. Larger IDs, common from databases and APIs, are rounded by JSON.parse, and numbers past about 1.8e308 become Infinity, while those too close to zero become 0. The viewer reads numbers as written, so it shows the real value, marks the row, and warns:
- JSON
- { "id": 9007199254740993, "ratio": 1e400, "tiny": 1e-400 }
- Warning
- JavaScript reads 9007199254740993 (line 1) as 9007199254740992, 1e400 (line 1) as Infinity, 1e-400 (line 1) as 0; they are shown here as written
Keep such IDs as strings, or parse them with a library that reads big integers.
JSON allows it, but most parsers, including JSON.parse, keep only the last value. The tree shows every copy as written, marks the last one, and names every repeat with its line:
- JSON
- { "name": "Ann", "age": 41, "name": "Bo" }
- Warning
- Duplicate key "name" (line 1); the last value is used
A path search such as $.name goes to the last copy, the one your code would get.
See also
- JSON Formatter & Minifier — to reformat or minify the JSON, or sort its keys.
- JSONPath Tester — to run a JSONPath query that selects many values at once.
- JSON to CSV Converter — to turn an array of objects into a spreadsheet.