JSON Formatter
Beautify or minify JSON, with errors pinned to the line
Everything runs in your browser. Your data never leaves your device.
Related tools
How to use
Formatting is a parse followed by a re-serialise. That means the tool validates as a side effect: if it produces output, your JSON is syntactically valid, and if it does not, the error tells you exactly where the parse stopped.
Paste your JSON
Type or paste into the left pane. Output appears as you type, so there is no button to press and no wait between editing and seeing the result.
Choose beautify or minify
Beautify expands the structure across lines for reading and diffing. Minify strips every optional byte of whitespace, which is what you want before sending JSON over the wire.
Set the indentation
Two spaces, four spaces or tabs. Match whatever your project already uses — mixed indentation produces noisy diffs that obscure real changes.
Fix errors using the line number
JavaScript reports a character offset, which is useless in a long document. The tool converts that offset to a line number so you can go straight to the problem.
Examples
Beautifying an API response
A single-line API response of a few thousand characters becomes a readable tree with two-space indentation, making it possible to scan the structure and spot a missing field.
Minifying before transport
A formatted 4KB configuration file minifies to around 2.8KB — roughly a 30% saving. Over a high-traffic API that whitespace is real bandwidth.
About this tool
Format messy JSON into readable, indented output, or minify it back down for transport. Invalid input is reported with the parser's message and the line it failed on, so you can fix it rather than guess. Everything runs in your browser, which means you can safely format payloads containing production data.