JSON viewer, formatter & validator
Paste JSON in the Text tab to validate, format or minify it, then switch to Viewer to browse it as a tree with a Name/Value grid. Errors show the exact line and column. Free, and nothing leaves your browser.
Paste the JSON code here — it is never uploaded or saved anywhere.
How to view, format and validate JSON
- Paste your JSON into the Text tab, or click Load JSON data to open a
.jsonfile. Click Sample if you just want to try it. - The status bar tells you straight away whether it’s valid JSON. If it isn’t, it shows the error and the line and column to fix.
- Click Format to pretty-print it with 2-space indentation, or Remove white space to minify it.
- Switch to the Viewer tab to browse the structure as a tree. Select a node to see its fields in the Name/Value grid and copy its path, or search for a key or value.
Common JSON errors and how to fix them
JSON is stricter than JavaScript. Most “invalid JSON” errors come from one of these:
- Trailing comma —
{"a": 1,}fails; remove the comma after the last item:{"a": 1}. - Single quotes —
{'a': 'x'}fails; JSON strings and keys need double quotes:{"a": "x"}. - Unquoted keys —
{a: 1}is a JavaScript object, not JSON. Quote the key:{"a": 1}. - Comments —
// noteand/* note */aren’t allowed in JSON. Delete them, or move the note into a field. - Non-JSON values —
undefined,NaNandInfinityaren’t valid. Usenullor a string instead. - Unescaped characters in strings — a raw line break or a lone
"inside a string breaks it. Escape them as\nand\".
JSON viewer, formatter or validator — which do you need?
They’re the same job from different angles, and this tool does all three. A validator tells you whether the text is legal JSON and where it breaks. A formatter (or beautifier) re-indents valid JSON so people can read it, and a minifier does the reverse for machines. A viewer lets you explore large or deeply nested JSON — like an API response — as a tree instead of scrolling through raw text.
FAQ
- Is this JSON viewer free?
- Yes — free, with no sign-up, no limits on use and no ads inside the tool.
- Is my JSON uploaded anywhere?
- No. Parsing and formatting happen entirely in your browser with JavaScript's built-in JSON parser — nothing you paste is sent to a server or stored, so it's safe for API responses and config that contain internal data.
- Why does it say my JSON is invalid?
- The status bar under the text box shows the parser's error with the line and column where parsing failed. The usual causes are a trailing comma, single quotes instead of double quotes, an unquoted key, or a comment — see the common errors above for fixes.
- What's the difference between Format and Remove white space?
- Format (pretty-print, or 'beautify') re-indents the JSON with 2 spaces so it's easy to read. Remove white space (minify) puts it on one line with no extra spaces — the smallest payload, which is what you'd send over an API.
- How do I use the Viewer tab?
- Click any node in the tree on the left to see its keys and values in the Name/Value grid on the right, with its path (like $.pricing.fromInr) ready to copy. Double-click a node or grid row to open it, use Expand all / Collapse all, or search keys and values to highlight matches.
- Can I open a .json file?
- Yes. Use Load JSON data in the Text tab to open a .json file from your computer; it's read locally by your browser, not uploaded.