JSON Minifier Online

Paste JSON and get it back with every unnecessary byte removed. The data is untouched, which you can check by expanding it again and comparing.

Input
Output

Paste something on the left. It is processed on this page and never uploaded.

What minifying removes

Whitespace between tokens, indentation and line breaks. That is all of it. JSON has no comments to strip and no syntax that can be shortened, so the saving comes entirely from formatting.

The saving is larger than people expect on deeply nested documents. A four-space-indented file ten levels deep can be forty percent whitespace by weight, and that whitespace is paid for on every request if the file is served without compression.

When it is worth doing

For a file served over HTTP with gzip or brotli enabled, minifying gains very little: the compressor already handles repeated spaces efficiently. The place it pays is where compression is not available or not applied, such as a value stored in a database column, a message on a queue, or a payload counted against a size limit.

For a file a human will read, do not minify. Keep the readable version in source control and minify at the point of use.

Questions

Does minifying change my data?

No. It removes formatting only. Parse the minified output and the original and you get identical structures.

Should I minify if my server already uses gzip?

Usually not worth it. Gzip compresses runs of spaces very efficiently, so minifying first typically saves a small percentage of the compressed size. It matters more where compression is absent, such as data stored in a column or sent through a queue.

Other tools