How to use the JSON Formatter
- Paste your JSON into the input box.
- Click Format to beautify it, or Minify to remove whitespace.
- If there is an error, the message shows where it is. Copy or download the result.
About this tool
APIs and config files often return JSON on a single unreadable line. Formatting adds indentation and line breaks so you can scan the structure. Minifying does the opposite to save space.
Validation uses the browser’s strict JSON parser, so trailing commas, single quotes and comments are reported as errors, as they would be in most APIs.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing and formatting run in your browser, so it is safe for API responses and config files.
Why are comments an error?
Standard JSON does not allow comments or trailing commas.
Can I sort keys?
Yes. Tick "Sort keys" before formatting.