What this JSON formatter does
JSON from APIs and log files often arrives as one unreadable line — or worse, with a syntax error buried in it. This tool does the three things developers need most: it formats (pretty-prints with your choice of 2 or 4-space indentation), it validates (confirming the JSON parses and reporting its size), and it minifies (stripping all whitespace for production payloads). When the JSON is invalid, you get the parser's exact error message instead of a silent failure, so you can find the missing comma or stray quote fast.
How to use it
- Paste your JSON into the top box.
- Choose an indent — 2 spaces, 4 spaces, or Minified.
- Click "Format JSON". Valid JSON appears formatted below with a confirmation; invalid JSON shows the precise error.
- Copy the result with one click.
Common JSON errors to look for
Trailing commas after the last item, single quotes instead of double quotes, unquoted keys, and comments are the four most common reasons JSON fails to parse — JSON allows none of them. Keys and strings must use double quotes, and control characters inside strings must be escaped. Because everything runs locally in your browser, you can safely format JSON containing API keys, tokens or private data.