Minifying JSON is deliberately the simplest transform this site does: the tool calls JSON.stringify() on the parsed value with no indentation argument, so the whitespace disappears and nothing else changes — same keys, same key order, same numbers, same string content. There is no separate minification algorithm to get wrong, because the engine's own serializer is the minifier.
That simplicity is also why this page exists: minifying is easy to do correctly and easy to reason about wrong. The sample below is loaded in the editor above with Minified selected, so you can paste your own JSON and watch the exact same substitution happen to it.
Before and after
This is what is loaded in the editor above.
{
"products": [
{
"id": 101,
"name": "Wireless Mouse",
"price": 129.9,
"inStock": true,
"tags": [
"electronics",
"accessories"
]
},
{
"id": 102,
"name": "Mechanical Keyboard",
"price": 349,
"inStock": false,
"tags": [
"electronics",
"accessories",
"gaming"
]
}
],
"page": 1,
"totalPages": 12
}{"products":[{"id":101,"name":"Wireless Mouse","price":129.9,"inStock":true,"tags":["electronics","accessories"]},{"id":102,"name":"Mechanical Keyboard","price":349,"inStock":false,"tags":["electronics","accessories","gaming"]}],"page":1,"totalPages":12}429 bytes → 254 bytes — a 41% reduction on this sample.
How it works
What actually gets removed
Only whitespace that exists between structural tokens — after a {, before a }, around a : or a , — is whitespace that JSON.stringify() never emits without an indentation argument. It is not a text-scanning pass over your file; it is the same code path that produces every other JSON.stringify() call in the language, so it has none of the escaping bugs a hand-written string minifier could introduce.
Key order is preserved exactly as it was in the parsed object. JavaScript objects keep insertion order for string keys (with one exception — integer-like keys such as "1" or "42" are always sorted numerically first, ahead of any other keys, regardless of where they appeared in the source). That reordering is part of the JavaScript specification, not something this tool adds.
Minified is not the same as Compact
The format selector above also offers Compact, which is a different, gentler transform: JSON.stringify(parsed, null, 1) — one space of indentation instead of two or four, but still one value per line. Minified removes structure entirely; Compact just shrinks it. Reach for Compact when a human still needs to read the diff, and for Minified when only a machine will consume the result.
Where minifying actually saves bytes
If a response is already served gzipped or brotli-compressed, most of the win from minifying disappears before it reaches the network: repeated whitespace is exactly the kind of redundancy those algorithms already remove well. Minifying matters most for payloads that are not compressed — some webhook bodies, local caches, embedded config files — and for reducing the work JSON.parse() has to do on very large documents, since fewer bytes means fewer characters to scan regardless of compression.
Known limitations
- Minifying does not change number formatting, remove unused fields, or shorten key names — it removes whitespace only. If you need a smaller payload beyond that, that is a schema change, not a minification setting.
- For a multi-megabyte document, JSON.parse() and JSON.stringify() both run synchronously on the main thread. Very large pastes can make the tab briefly unresponsive while they run; this is a property of the browser's JSON implementation, not something this page adds on top of it.
Minify JSON FAQ
Does minifying change the data in any way?
No. Every key, value, and array element is preserved exactly. Only the whitespace between them is removed.
What is the difference between Minified and Compact?
Minified removes all whitespace, producing one line. Compact keeps one value per line but with minimal indentation. Use Compact when a person still needs to read it, Minified when only a machine will.
Will this help if my API responses are already gzipped?
Less than you might expect. Gzip already compresses repeated whitespace efficiently, so minifying before compression yields a smaller extra saving than the raw byte count above suggests. It matters more for uncompressed payloads.
Is my JSON uploaded anywhere?
No. JSON.parse() and JSON.stringify() run in your browser. Nothing is sent to a server, which matters if the payload contains real customer or account data.
Other JSON tools
Need the full set of options — sorting, indentation, table and tree views? The general JSON formatter has all of them in one place.