What is JSON minification?
JSON minification removes all whitespace characters — spaces, tabs, and newlines — that exist only for human readability. The resulting JSON is functionally identical to the original: the same data, same structure, same values. It is simply more compact. Any JSON parser will produce the same result from both the formatted and minified versions.
Before and after minification
Before (formatted, 55 bytes):
{
"name": "John",
"age": 25,
"active": true
}After (minified, 38 bytes):
{"name":"John","age":25,"active":true}Minification vs network compression
JSON minification and network compression (gzip, Brotli) are different and complementary techniques:
- Minification removes whitespace from the JSON text itself. The result is a smaller but still plain-text JSON file.
- Network compression (gzip, Brotli) compresses data at the HTTP transport layer. Most web servers enable this automatically. It compresses any text — minified or not.
- Using both together gives the best results: minify the JSON to remove redundant characters, then let the server compress the transport payload.
When to minify JSON
- Before embedding JSON in production JavaScript bundles
- When storing JSON in a database and space matters
- When sending JSON in a request body from a client
- When config files are loaded at runtime and size affects startup time
- When comparing two minified JSON strings for equality
Frequently Asked Questions
Does minification change my data?
No. Minification only removes whitespace (spaces, tabs, newlines) that is not part of any string value. The data, structure, and all values remain exactly the same. A JSON parser will produce identical output from both the original and minified versions.
What if my JSON has whitespace inside string values?
Whitespace inside string values is preserved. Minification only removes whitespace that is part of the JSON structure (between keys, colons, commas, and brackets). For example, a value like "hello world" will remain unchanged.
How do I undo minification?
Use the JSON Formatter to pretty-print a minified JSON string back into a readable format.
Is there a file size limit?
There is no hard size limit for text pasted into the editor. Very large inputs may be slow to process depending on your device.
