JSON File Viewer
A JSON file viewer opens a .json file and shows its contents in a readable form: an indented tree or formatted text. JSON is a text format (RFC 8259), so any text editor can open it, but a viewer adds indentation and collapsing. If the file does not parse, this viewer shows the line and column of the error and can repair it.
Open a JSON file or paste JSON
Click Open file and pick the file, or drag it from your desktop onto the input box. You can also paste the contents. The file picker lists .json, .geojson and .txt files by default; a dropped file can have any name, as long as the contents are JSON.
The browser reads the file with its own file reader; this page makes no network request with the contents. Files saved as UTF-8 open with or without a byte order mark. UTF-16 files open when they start with a byte order mark; a UTF-16 file without one does not decode and shows as invalid. RFC 8259 asks for UTF-8 when JSON is exchanged between systems, so re-save such a file as UTF-8.
Files up to 50 MB open; larger ones are refused with a message. In desktop Chrome a 1.7 MB file showed as a tree in about half a second, a 17 MB file in about 1.2 seconds and a 42 MB file in about 2 seconds. Text over 1 MB is kept out of the input box, and the Text view draws the first 1 MB of indented text (Copy still copies all of it). Phones and older computers are slower.
If you only want to paste JSON and explore it, the JSON viewer is the same tool with paste first.
How to view a JSON file without a tool
JSON is plain text, so any text editor shows it. Browsers handle it differently: Firefox (tested on version 158) opens a local .json file in its built-in viewer with a tree and a Raw Data tab, and Chrome (tested on version 155) shows the text with a Pretty-print checkbox. A text editor does not check that the file is valid; this page does.
Tree view versus formatted text
- Tree — for browsing nested data. Each row shows its type (object with its number of keys, array with its number of items, string, number, boolean, null). Click a row to fold it, or use Expand all and Collapse all. Hover a row to copy path (JSONPath such as
$.items[3].id) or copy value. - Text — the whole file indented with two spaces, with a Copy button. Use it to read the raw JSON or paste it elsewhere.
The viewer has no search box; to pull values out by path, use the JSONPath tester.
How to view a JSON error file
A file that will not open as a tree is not valid JSON. The viewer stops at the first error and shows the message, the line and column, and the line itself with a caret under the spot. These are the messages for three common faults, and what the repair step returns:
| Problem | Invalid JSON | Reported error | Repair result |
|---|---|---|---|
| Trailing comma | {
"a": 1,
"b": 2,
} | Line 4, column 1: Trailing comma — remove the comma before the closing }. | {"a":1,"b":2} |
| Single quotes | {
'a': 1
} | Line 2, column 3: Property names must use double quotes ("), not single quotes. | {"a":1} |
| Wrong closing bracket | {
"a": [1, 2
} | Line 3, column 1: Mismatched bracket: found } but the array opened at line 2, column 8 needs ]. | {"a":[1,2]} |
The messages come from the same checker as the JSON validator. Repair and view runs the engine behind the JSON repair tool, which also removes comments, quotes unquoted keys, converts Python True/False/None, strips Markdown code fences and closes cut-off files. The repaired text replaces the input, so keep the original file if you need it.
If the "error file" is an error response you saved from an API, it is usually valid JSON and opens as a tree; the meaning of its fields comes from that API's documentation, not from the JSON standard. Parser messages by language are listed under JSON errors.
What the JSON standard requires of a valid file
- Strings and object keys in double quotes (RFC 8259, section 7 and section 4).
- Values separated by commas, with no comma after the last one.
- No comments: the grammar has none.
- Values are objects, arrays, strings, numbers,
true,falseornull. - UTF-8 encoding when the file is exchanged between systems (section 8.1).
Other things to do with the file
- Format it with 2 or 4 spaces, or minify it.
- Query it with JSONPath, or diff it against another version.
- Convert it to CSV, YAML, XML or SQL, or generate TypeScript types or a JSON Schema, in JSON Studio; the convert guides explain the trade-offs.
- Learn the format from the start in Learn JSON.
Frequently asked questions
Open the file here. If it does not parse, read the reported line and column, fix that spot, or click Repair and view. If the file is an error response saved from an API, it is often valid JSON and opens as a normal tree.
Yes. JSON is plain text as defined in RFC 8259, so any text editor opens it. A viewer adds indentation and collapsible nesting, which helps with large or minified files.
It is probably not valid JSON. Common causes are trailing commas, single-quoted strings, comments, unquoted keys and a file that was cut off; RFC 8259 allows none of them. The viewer shows the line and column of the first error.
Yes, 50 MB. In desktop Chrome a 42 MB file opened as a tree in about 2 seconds. Larger files are refused with a message.
Yes. Repair and view runs the site's repair engine in your browser and shows the result as a tree. It fixes faults such as trailing commas, single quotes and missing brackets. Check the result before using it, since repair changes the original text.
The JSON Medic newsletter
One JSON error and its fix, weekly, plus new guides and tools. Free.
We send a confirmation link first. Unsubscribe with one click in any mail. See the privacy policy.
Related JSON tools