JSON Formatter
Browser processing — files never leave your device
Paste minified or messy JSON and get a cleanly indented, readable version. Invalid JSON produces an error with the line and position of the problem.
Loading tool…
How to use this tool
- Paste JSON into the input panel.
- Choose 2-space or 4-space indentation.
- Click Format — or fix the reported error if the input is invalid.
- Copy the formatted output.
About this tool
APIs return JSON on a single line; humans read it indented. This formatter parses your input with the browser's native JSON engine — the same strict parser your code will use — and re-serializes it with your chosen indentation. Because parsing is strict, formatting doubles as validation: trailing commas, single quotes and unquoted keys are reported with their location instead of being silently accepted. Your data stays in the browser, which matters when the JSON contains tokens or customer data.
Frequently asked questions
- Why does my JSON fail with a trailing comma?
- The JSON specification forbids trailing commas, even though JavaScript allows them. The error message points at the comma so you can remove it.
- Does formatting change my data?
- No — only whitespace changes. Keys, values and their order are preserved exactly.
- Is it safe to paste API responses with tokens in them?
- Formatting happens entirely in your browser; nothing is transmitted. Still, avoid sharing formatted output that contains live credentials.
Related tools
JSON MinifierStrip every unnecessary space and line break from JSON to get the smallest valid representation — with the size saving shown.JSON ValidatorCheck whether a JSON document is valid. Errors are reported with line and column, plus a plain-English explanation of the likely cause.CSV to JSONTurn CSV data — pasted or from a file — into a JSON array of objects, using the header row as keys. Quoted fields and embedded commas are handled correctly.JSON to CSVConvert a JSON array of objects into CSV that opens cleanly in Excel or Google Sheets, with correct quoting and a stable column order.