Paste or open JSON to remove all unnecessary whitespace and line breaks, see how much smaller it gets, and download it as .json or .json.gz.
How it works
Open or paste JSON
Paste JSON, open a .json or .json.gz file, load one from a URL or use the sample.
Minify or beautify
Minify removes whitespace outside strings; Beautify indents with 2 spaces, 4 spaces or tabs. The size before and after is shown.
Download or copy
Download the result as .json or compressed .json.gz, copy it, or open it in the JSON Viewer.
Features
Exact minification
Only whitespace between tokens is removed. Strings, escapes, numbers and key order stay exactly as written, so long numbers are never rounded.
Size savings
See the size before and after and the percentage saved, plus the gzip size when compression is on.
Gzip download
Download as .json.gz compresses the result with gzip, the same compression web servers use.
Clear errors
Invalid JSON is reported with line and column. Minify invalid JSON as text removes whitespace outside strings anyway.
Beautify too
Switch to Beautify to indent minified JSON and make it readable again.
Limits & privacy
JSON files can be up to 200 MB, also after decompressing a .json.gz file. Files above 5 MB are converted from the file without loading them into the editor.
Minifying does not remove keys or empty values. See the privacy page.
FAQ
How do I compress JSON to one line?
Paste the JSON with Minify selected. All line breaks and indentation outside strings are removed and the result is a single line.
How do I compress a JSON file?
Open the file, then press Download .JSON for the minified file, or turn on Download as .json.gz for a gzip-compressed one.
How much smaller will my JSON file get?
It depends on the indentation. The size before and after and the percentage are shown; gzip usually shrinks text data much further.
Does minifying change my data?
No. Only whitespace outside strings is removed. Values, key order and numbers stay exactly the same.
Can I compress a JSON string with errors?
Turn on Minify invalid JSON as text. Whitespace outside strings is removed, and the error position is still shown.
Is this JSON compressor online free?
Yes. It is free, and files are processed in your browser; nothing is uploaded.