JSON Formatter & Validator

Pretty-print, minify and validate JSON instantly.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

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 messageLikely cause
Unexpected token } in JSONTrailing comma after the last item
Unexpected token 'Single quotes used instead of double quotes
Expected property nameAn unquoted object key
Unexpected end of JSON inputA missing closing } or ]
Unexpected non-whitespace characterExtra content after the JSON value

Everything runs locally in your browser — your JSON is never uploaded.

Ad placeholder (rectangle)