JSON Formatter
Paste JSON to pretty-print, validate, or minify it. Errors are pinpointed with a clear message. Everything runs locally in your browser.
How to use this tool
- Paste your JSON into the input box.
- Click Format to pretty-print it with your chosen indentation, or Minify to strip all whitespace.
- If the JSON is invalid, read the error message — it describes exactly what the parser choked on.
- Copy the result with one click.
How it works
The tool uses your browser's native JSON parser (JSON.parse), so validation matches exactly what JavaScript applications will accept. Formatting re-serializes the parsed structure with your chosen indentation — the data itself is untouched.
The most common JSON errors: trailing commas after the last item, single quotes instead of double quotes, unquoted keys, and comments (standard JSON allows none of these).
Frequently asked questions
Why is my JSON invalid?
The usual suspects: a trailing comma after the last element, single quotes instead of double quotes, unquoted property names, or comments. Standard JSON forbids all four, even though JavaScript object literals allow them.
What's the difference between formatting and minifying?
Formatting adds line breaks and indentation for humans to read. Minifying removes all unnecessary whitespace to make the payload smaller for transmission. Both produce semantically identical JSON.
Is it safe to paste sensitive JSON here?
The JSON never leaves your browser — parsing and formatting are local. Still, as a habit, avoid pasting production secrets into any web page.