How to Minify JSON
JSON minification removes insignificant whitespace outside string values — spaces, tabs, and newlines — from a JSON document, reducing its size without changing the data. It is the opposite of beautification and is used in production to reduce bandwidth, speed up API responses, and save storage space.
What is minified JSON?
Minified JSON is the same document written without optional whitespace outside its strings. Compact JSON and one-line JSON refer to this presentation. Spaces inside values stay intact. Minification produces text; gzip and Brotli are separate transport-compression steps.
For example, the UTF-8 document { "a": 1 } is 10 bytes; {"a":1} is 7 bytes, saving 3 bytes. Non-English characters may take more than one byte, so character counts are not file-size measurements.
Try minifying your own JSON
Removes whitespace outside strings without rewriting numeric tokens. Size is measured as UTF-8 bytes. This is minification, not gzip compression.
{
"user": {
"id": 1,
"name": "Alice",
"email": "[email protected]",
"roles": ["admin", "editor"],
"active": true
}
}What Does JSON Minification Do?
A JSON minifier removes every character that is not part of the data itself:
- Spaces and tabs used for indentation
- Newline characters between keys and values
- Spaces around colons and commas
The resulting JSON is semantically identical — any JSON parser will read it exactly the same way. Only whitespace is removed; all keys, values, and structure are preserved.
How to Minify JSON Online — 3 Steps
When Should You Minify JSON?
When NOT to Minify JSON
Minification is for production and storage — not for development. During development, keep JSON formatted so you can:
- ✕Read and debug API responses without a tool
- ✕Review JSON config files in pull requests
- ✕Edit JSON files manually without introducing syntax errors
- ✕Log readable output during troubleshooting
JSON Minify vs JSON Beautify — Quick Comparison
- · Removes all whitespace
- · Smallest file size
- · Use in production
- · Not human-readable
- · Adds indentation & line breaks
- · Larger file size
- · Use in development
- · Human-readable
Minify Your JSON Now
Free, instant, and 100% private — processed entirely in your browser.
Open JSON Minifier