Pretty-print JSON or minify it to one line
Format JSON with indent for reading, or minify whitespace for APIs. Validate and optionally repair broken input.
Paste JSON and pick a mode: formatting adds indentation and highlights errors, minification compresses it into one line for storage and transport.
Invalid JSON shows the error position; loose repair is available. Key order is kept in the default mode.
Pretty-print with two spaces turns a one-line payload into something you can diff. Minify removes that whitespace again for a request body. Trailing commas and single quotes are not JSON; a repair pass may fix them and may also change meaning, so read the result. Key order stays as pasted unless you sort. JSON.parse accepts 1e2 as 100, but a hand-written 01 is invalid. This page opens on pretty-print. The comparison page is about when to store the minified form.
FAQ
Is key order kept?
Yes by default. Sort mode reorders keys.
Will data be lost when minifying?
No. Only whitespace formatting changes.
