JSON Formatter/Minifier
Paste JSON to get a formatted, validated, or minified version, with syntax error detection.
About: JSON Formatter/Minifier
This JSON formatter validates your JSON and rewrites it with clean indentation, or minifies it onto a single line. When there's a syntax error, it shows the parser message and the offending line, then offers an automatic fix for the most common mistakes. Use it to read a messy API response, tidy a config file before committing it, or shrink a payload. Copy the result in one click; nothing ever leaves your browser.
Features
- Pretty-printing with two-space indentation, or minification that strips every unnecessary space.
- Validation as you type, with the parser's error message and the faulty line highlighted in the gutter.
- Suggested fix for trailing commas, unquoted keys and single quotes, with a before/after preview.
- One-click copy of the output, undo and redo, and a button to reset the editor.
How to use it
- Paste your JSON into the Input panel.
- Pick the Format tab to indent it or the Minify tab to compact it.
- If an error appears, apply the suggested fix or correct the reported line.
- Copy the output from the toolbar.
Questions about usage
No. Validation, formatting and minification all happen in your browser using the native JSON parser. The content is kept in the page URL so you can reload or reopen the link without losing it, but it is never sent to a server.
It removes trailing commas before a closing brace or bracket, adds missing double quotes around keys, and turns single quotes into double quotes. The suggestion only appears when the result is valid JSON, and you see the changed lines before applying it. For example:
js{ name: 'Tegmen', tools: 19, }
becomes:
json{ "name": "Tegmen", "tools": 19 }
Formatting adds line breaks and two-space indentation so the structure is easy to read. Minifying removes all optional whitespace and line breaks to get the most compact version, which helps when you need a smaller payload or a one-line value for an environment variable.