Format and validate JSON in your browser
This tool pretty-prints, minifies, and validates JSON without sending it anywhere. Paste an API response, a config file, or a log line and get clean, indented JSON back — or a precise error message if it’s malformed. It’s built for developers debugging APIs, anyone tidying config files, and people who handle sensitive payloads they don’t want pasted into a random website.
How it works
The tool runs the browser’s native JSON.parse(input). If parsing succeeds, the
result is re-serialised with JSON.stringify(parsed, null, indent) for
pretty-printing (you choose the indent width, default 2 spaces) or
JSON.stringify(parsed) with no spacing for minifying. Because it parses before
re-printing, any formatted output is guaranteed to be valid JSON. If
JSON.parse throws, the parser’s own error message — often including the
character position — is shown so you can locate the problem.
Example
Paste this messy input:
{"name":"Ada","roles":["admin","editor"],"active":true}
Pretty-printing with a 2-space indent returns:
{
"name": "Ada",
"roles": [
"admin",
"editor"
],
"active": true
}
Minifying the same data collapses it back to one line with no spaces.
Common JSON syntax errors
| Error message | Likely cause |
|---|---|
Unexpected token } in JSON | Trailing comma after the last item |
Unexpected token ' | Single quotes used instead of double quotes |
Expected property name | An unquoted object key |
Unexpected end of JSON input | A missing closing } or ] |
Unexpected non-whitespace character | Extra content after the JSON value |
Everything runs locally in your browser — your JSON is never uploaded.