Free JSON Formatter & Validator
Paste JSON, get instant pretty-print, validation, and minify — all in your browser.
{ "name": "Ada Lovelace", "age": 36, "active": true, "roles": [ "admin", "editor" ] }
How to use / FAQ
Paste or type JSON into the input box and it’s pretty-printed and validated as you type — no button to press. Switch between 2- and 4-space indentation, or hit Minify to strip every space and newline for a compact one-line version to drop into code or a config value. If the JSON is invalid, the tool points you straight to the problem instead of failing silently.
This is the fastest way to make sense of a minified API response, tidy a config file before committing it, or check why a payload is being rejected. Because a single missing comma renders a whole document unparseable, the validator runs on every keystroke and reports the exact line and column of the first error — you fix it, and the formatted output reappears instantly. Everything happens on your device, so it’s safe to paste responses that contain tokens, keys, or customer data.
Is my data uploaded anywhere?
No — parsing and formatting happen entirely in your browser. Nothing you paste is sent to a server, so it's safe for API responses or config that contains secrets.
What does the error message mean?
It points to the line and column where the parser gave up, so you can jump straight to the typo, missing comma, trailing comma, or stray bracket that broke the JSON.
Why is my JSON invalid when it looks fine?
The usual culprits are things JavaScript allows but JSON doesn't: single quotes instead of double quotes, a trailing comma after the last item, unquoted property names, comments, or NaN/Infinity/undefined as values. Curly “smart quotes” pasted from a chat app or document are another silent killer — they look like quotes but aren't the ASCII character JSON requires.
What's the difference between JSON and a JavaScript object?
JSON is a stricter text format: every key must be a double-quoted string, values are limited to objects, arrays, strings, numbers, booleans, and null, and there are no comments, functions, or trailing commas. A JavaScript object literal often won't validate as JSON until those relaxations are removed. If you want typed access to a payload in code, the JSON to TypeScript converter turns a sample into interfaces.
What's the difference between Format and Minify?
Format adds consistent indentation and line breaks so the structure is easy to scan; Minify removes all optional whitespace to make the payload as small as possible. Both keep the underlying data identical.
Should I indent with 2 or 4 spaces?
Both are valid JSON — it's purely a readability preference. Two spaces is the convention in most of the JavaScript ecosystem (npm, Prettier's default for JSON); four spaces gives deeper visual nesting that some teams find easier to scan. The toggle re-formats instantly, so pick whichever matches the codebase the file lives in.
Does formatting ever change my data?
Formatting only changes whitespace, with one caveat inherited from every JavaScript-based tool: numbers longer than about 15–16 significant digits (like some database IDs) are stored as double-precision floats and can lose their final digits. If you see a long ID change, keep it as a string in the source data.
Can it handle large JSON files?
Yes, though very large documents (over a megabyte or so) may format slowly because everything runs on your device rather than a server. Minify is the lighter operation for big payloads.