Paste JSON to format it, find syntax errors, and explore it as a collapsible tree. Everything runs in your browser, so your data is never uploaded.
How to use the JSON viewer
- Add your JSON. Paste it into the Input panel, drop a
.jsonfile onto it, or choose Open file. Load sample fills in an example so you can try every feature. - Check the status bar. It reports whether the JSON is valid. If it is not, you get the line and column of the first problem, plus a red marker in the editor.
- Format or minify. Format indents the document with two spaces. Minify removes all optional whitespace, which is useful for API requests and config values.
- Explore the result. Switch between Raw, Tree, Minified and Validate. In the tree, click any row to see its path (for example
$.inventory[0].title) and copy it, or right-click for more options.
What you can do with it
- Validate JSON against the strict syntax rules and see exactly what is wrong.
- Beautify and minify without changing your data. Number digits, key order and string escapes are kept exactly as you typed them.
- Browse as a tree with collapsible nodes, item counts, and a search box that highlights matching keys and values.
- Auto-fix common mistakes such as trailing commas, single quotes and comments.
- Full screen and layouts hide the page around the tool and let you switch between split, tree-only and input-only views. Expand the tree to a chosen level and change the text size. The Raw tab is an editor: change the JSON there and the tree, minified and validate views update as you type. Press Esc to leave full screen.
- Export the formatted result as
data.json.
Common JSON errors and how to fix them
Most invalid JSON comes from habits carried over from JavaScript, Python or hand-edited config files. These are the mistakes you will see most often.
| Mistake | Invalid | Valid |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comment | {"a": 1} // note | {"a": 1} |
| Non-JSON value | {"a": undefined} | {"a": null} |
| Python literal | {"a": True} | {"a": true} |
The reported position is where the parser noticed the problem, which is often just after the real mistake. A missing comma or an unclosed bracket on the previous line is a frequent cause, so look at the lines above the marker as well as the marked one.
What auto-fix changes, and what it does not
Auto-fix edits only the structure of your text. It never touches the contents of a string, so a URL such as "https://example.com" or a value containing a comma or brace is left alone. It can:
- remove
//and/* */comments, - remove trailing commas,
- convert single-quoted strings to double-quoted strings,
- put quotes around unquoted keys,
- replace
undefined,NaNandInfinitywithnull, and convert Python'sTrue,FalseandNone, - add missing closing brackets at the end of truncated JSON.
It does not guess missing commas between values or repair unescaped quotes inside strings. The message after each fix lists what was changed. Review the result before you use it, especially after a truncated document was closed, because the missing data is still missing.
JSON syntax rules at a glance
- A value is an object, array, string, number,
true,falseornull. - Strings and keys use double quotes. Control characters must be escaped, for example
\nfor a newline. - Numbers have no leading zeros, no leading
+, and no hexadecimal form. - Entries are separated by commas, with no comma after the last one.
- Comments are not part of the specification. Files such as
tsconfig.jsonand VS Codesettings.jsonallow them because they use a superset often called JSONC, so a strict validator will flag them. - Keys inside one object should be unique. Parsers differ in how they treat duplicates, so the Validate tab warns you.
Working with very large numbers
JavaScript stores numbers as 64-bit floating point values, so integers above 9,007,199,254,740,991 lose precision when they are parsed. Database IDs and snowflake IDs often exceed that. This tool formats and minifies the original text, so those digits are kept intact. The tree view has to use JavaScript numbers and may show a rounded value, and the Validate tab tells you when this applies.
Frequently asked questions
Is the JSON viewer free?
Yes. There is no account, trial or usage limit.
Is my JSON uploaded anywhere?
No. Formatting, validation and searching all run in your browser with JavaScript, and nothing you paste is sent to our servers. You can confirm this by opening your browser's network panel while you use the tool. The only thing stored on your device is your light or dark theme choice.
Why does it say my JSON is invalid?
JSON is stricter than JavaScript object syntax. Check the Validate tab for a list of likely causes, then use Go to error to jump to the position the parser reported. If the cause is one of the common mistakes above, Fix can usually repair it for you.
How large a file can I open?
Formatting, minifying and the Raw view handle several megabytes, limited by your device's memory. To keep the page responsive, the tree view pauses above 40,000 nodes and offers to render anyway or switch to Raw view.
Does minifying change my data?
No. It removes whitespace outside of strings and nothing else. Keys, values, order and number formatting stay the same.
What is the difference between a JSON viewer, formatter and validator?
A formatter rewrites the text with consistent indentation, a validator checks that it follows the JSON rules, and a viewer lets you explore the structure. This page does all three, so you can paste once and switch between them.