Strip all unnecessary whitespace from JSON to its smallest valid form — with an exact before/after size comparison. Data and key order are untouched.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Smallest valid JSON, nothing else changed
Minifying removes every space, tab and line break that sits between tokens — the whitespace that exists only for human eyes. Whitespace inside string values is data and is always preserved. The result is the same document in its smallest valid form, and the stats line reports the exact byte reduction.
Worked example
{
"product": "Laptop Stand",
"price": 51.25,
"tags": [ "office", "desk" ]
}becomes:
{"product":"Laptop Stand","price":51.25,"tags":["office","desk"]}When to use it
- Shrinking payloads before embedding them in code, environment variables or data attributes.
- Preparing fixtures where size matters more than readability.
- Normalizing JSON to single-line form for log pipelines that expect one record per line.
Limitations to know
- Minification is not compression — for network transfer, servers gzip/brotli JSON anyway, and the Size Calculator shows how the forms compare.
- The input must be valid JSON; errors come back with line and column.
Common questions in practice
- Reversing it — the JSON Formatter restores readable indentation at any time; minification loses nothing.
- Escaped characters — sequences like
\ninside strings are content, not formatting, and pass through untouched.
How to use the JSON Minifier
- Paste formatted or messy JSON into the input.
- Click "Minify JSON".
- Check the stats line for the exact size reduction.
- Copy the single-line result or download it.
Frequently asked questions
What does minifying JSON remove?
Only insignificant whitespace: spaces, tabs and line breaks between tokens. Whitespace INSIDE string values is meaningful data and is always preserved. The result is byte-for-byte the same data in the smallest valid form.
How much smaller does minified JSON get?
Typically 20–40% smaller than pretty-printed JSON, depending on nesting depth and indentation. The stats line shows your exact numbers. Note that gzip compression on the wire shrinks both forms a lot further.
Is minified JSON still valid?
Completely. Whitespace between tokens carries no meaning in JSON, so parsers treat minified and formatted versions identically.
Should I minify JSON config files?
Usually not — configs are read by humans more often than machines. Minify payloads that ship over the network or into storage; keep configs formatted. The JSON Formatter reverses minification instantly.