JSON Formatter
Paste JSON below, then pretty-print or minify. Invalid JSON gets a specific error, not a blank screen — nothing you paste leaves your browser.
Format, validate, and shrink JSON in one step
JSON.parse either succeeds or throws — so validation is a free side effect of formatting. This tool parses whatever you paste; if it's valid, Pretty-print reformats it with 2-space indentation for readability, and Minify strips every non-essential character for the smallest possible payload. If it's invalid, you get the parser's actual error message, plus the character position it points to, so you can jump straight to the problem instead of scanning the whole file.
Worked example
Input: {"user":"Ada","admin":true,"roles":["dev","ops"]}
(49 bytes, 3 keys). Pretty-print produces:
{
"user": "Ada",
"admin": true,
"roles": [
"dev",
"ops"
]
}
— 75 bytes, formatted for reading. Minify on the
same input returns it exactly as it started, at 49 bytes, since
it already had no extra whitespace. Now try {"user":"Ada","admin":true,} — the trailing
comma after true is invalid JSON, and the tool
reports the parser's real error along with the position of the
character it choked on, rather than failing silently.
Frequently asked questions
What makes JSON invalid?
The most common culprits: a trailing comma after the last item in an object or array ({"a":1,}), single quotes instead of double quotes ('key' instead of "key"), unquoted keys ({key: 1} instead of {"key": 1}), and comments (// or /* */ — strict JSON has no comment syntax at all). All four are common in JavaScript object literals, which is exactly why pasting JS code as JSON so often fails.
Is my data uploaded anywhere?
No. Parsing, pretty-printing, and minifying all happen in your browser via JSON.parse and JSON.stringify — nothing you paste is sent to a server, stored, or logged.
What does minifying actually save?
Minify strips all the whitespace — indentation, line breaks, spaces after colons — that pretty-printing adds for humans to read. That shrinks payload size, which matters for API responses and config files sent over the network. It is not obfuscation or encryption: every key and value is still there in plain text, just packed tighter.
Does this validate my JSON against a schema?
No — this tool checks SYNTAX only: are the braces balanced, are strings quoted correctly, is every comma where it should be. It has no idea whether your data has the right fields, types, or shape for your application. For that you need JSON Schema validation, which is a separate, structural check this tool does not perform.