Strip every unnecessary space and line break from your JSON to make it as small as it can be.
Loading the tool...
How to use JSON Minify
Paste indented JSON on the left.
The minified result appears on the right. Check the size line below the panes to see how much you saved.
Copy it or download it.
About JSON Minify
Minifying JSON removes all whitespace that is not part of a string value. The data stays the same, the file gets smaller. On a typical pretty printed API response you save somewhere between a quarter and a third of the size.
It is useful when you embed JSON in a URL parameter, an environment variable, an HTML data attribute or a database column, and anywhere else a line break would cause trouble.
Frequently asked questions
Is minified JSON still valid?
Yes. Whitespace between tokens has no meaning in JSON, so the compact version is read exactly the same way.
Is minifying the same as compressing with gzip?
No. Minifying removes characters from the text itself. Gzip compresses the bytes during transfer. They work well together, but minifying alone is helpful when gzip is not available.
Does it touch spaces inside strings?
Never. Anything between double quotes is left exactly as it is, including spaces, tabs and escaped line breaks.
Can I reverse it?
Yes, paste the compact text into the JSON Formatter and pick an indent. You get a readable version back, though the original formatting choices are not recoverable.