CalculatorsConvertersDeveloperTextAll toolsDirectory
Submit your tool Sign in
Theme
Home/Answers/Developer
How-to

How do I minify JSON to reduce its size?

Short answer

Paste the JSON into a browser-based minifier and it strips every space, newline and indent, leaving the smallest valid equivalent. The minification runs on your own device, so a config or API payload full of internal ids is never uploaded, and the output is byte-for-byte the same data with none of the whitespace.

What minifying actually removes

Pretty-printed JSON is padded with indentation and line breaks that make it readable but add nothing to the data. A minifier removes all of that insignificant whitespace between tokens while keeping the structure identical, so the parsed result is exactly the same object. On large documents the saving is real, which is why APIs and bundlers ship minified JSON over the wire.

Minify to ship, format to read

The two operations are opposites you use at different moments. You format JSON with indentation while debugging so you can read it, then minify it for storage or transport where every byte counts. A tool that does both means you can flip a payload between the compact and readable forms without leaving the page, and because it runs client-side the data stays on your machine either way.

Step by step

  1. Paste the JSON. Paste the formatted JSON into the minifier.
  2. Minify locally. The tool removes all insignificant whitespace in your browser, nothing is uploaded.
  3. Copy the compact JSON. Copy the minified output for storage or transport.

Frequently asked questions

Does minifying change the data?

No. It only removes whitespace between tokens. The parsed object is identical to the original.

Is my JSON uploaded?

No. Minification runs entirely in your browser, so the data never leaves your device.

Can I get the readable version back?

Yes. Run the minified JSON through the formatter to re-indent it. No information is lost by minifying.

Related answers