JSON Formatter & Validator
Paste JSON below, then pretty-print or minify. Invalid JSON gets the parser's real error, not a guess — nothing you paste ever 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 and tells you honestly which happened.
Pretty-print reformats valid JSON with your
choice of 2-space, 4-space, or tab indentation for readability,
and Minify strips every non-essential
character for the smallest possible payload. If the input is
invalid, you get the parser's actual SyntaxError
message rather than a hand-rolled guess at what's wrong — it's
less polished, but it's accurate, and most engines point
straight at the character position that broke.
Worked example
Input: {"user":"Ada","admin":true,"roles":["dev","ops"]}
(49 characters, 3 keys). Pretty-print with
2-space indent produces:
{
"user": "Ada",
"admin": true,
"roles": [
"dev",
"ops"
]
}
— 75 characters, formatted for reading. Minify
on the same input returns it exactly as it started, at 49
characters, since it already had no extra whitespace. Now try {"user":"Ada","admin":true,} — the trailing
comma after true is invalid JSON, and this tool
shows you the browser's own parser error instead of failing
silently or making one up.
Frequently asked questions
What makes JSON invalid?
The usual suspects: 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}), and comments (// or /* */ — strict JSON allows none). All four are legal in JavaScript object literals, which is exactly why pasting JS code as JSON so often fails here.
Why does the error message look so technical?
It's not our wording — it's JSON.parse's own SyntaxError message, shown to you exactly as the browser produced it, rather than a made-up description of where we think the problem is. It's honest about being a real parser error, and different browsers phrase it slightly differently, but all of them tell you the character position to jump to.
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. That's true for every tool on this site.
Does this validate my JSON against a schema?
No — this checks SYNTAX only: balanced braces, correctly quoted strings, commas in the right places. It has no idea whether your data has the right fields, types, or shape for your application — that's a separate check called JSON Schema validation, which this tool doesn't perform.