JSON Formatter
This JSON formatter parses the JSON you paste, shows the exact error if it is invalid, and outputs it either pretty-printed with 2-space indentation or minified to a single line.
About JSON Formatter
This free JSON formatter instantly validates and prettifies your JSON with proper indentation. Use it to debug API responses, config files, or any JSON data. The minify option removes whitespace to reduce file size.
About this tool
This JSON formatter parses the JSON you paste, shows the exact error if it is invalid, and outputs it either pretty-printed with 2-space indentation or minified to a single line.
How to use it
- Paste your JSON into the input box.
- Click Format to indent it with 2 spaces, or Minify to remove all whitespace.
- If the JSON is invalid, read the error message shown in the output.
- Click Copy Output to copy the result.
Good to know
- Validation uses the browser's native JSON.parse, which follows the JSON standard (RFC 8259) strictly.
- Trailing commas, single-quoted strings and comments are not valid JSON and will be reported as errors.
- Formatted output uses 2-space indentation; minified output removes all insignificant whitespace.
- Minifying JSON typically shrinks it noticeably, which helps when sending payloads over an API or storing config.
Runs entirely in your browser — nothing you enter is uploaded or stored.
Frequently asked questions
Is it safe to paste API keys or tokens into this JSON formatter?
Yes. Parsing and formatting happen entirely in your browser with JavaScript, so the JSON is never sent to a server.
Why does my JSON show an error?
The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys and comments. JSON only allows double-quoted strings and keys.
What is the difference between Format and Minify?
Format adds line breaks and 2-space indentation so the structure is easy to read. Minify removes all whitespace to make the JSON as small as possible.
Does the formatter change my data?
No. It only changes whitespace. Keys, values and their order stay exactly as parsed.