JSON Minifier
Remove whitespace from JSON to reduce its size.
What is JSON Minifier
JSON minification removes line breaks and whitespace from JSON to reduce data size, commonly used to cut transfer overhead.
🔒 Everything runs in your browser. Nothing is uploaded.
What this tool actually does with your file
- Where it runs
- In your browser, on this page
- Upload
- None — the file never leaves your device
- Offline
- Works with the network disconnected
Removing whitespace without touching strings
Whitespace outside string literals is insignificant in JSON, so it can be dropped entirely. The subtle part is that whitespace inside strings is data: "hello world" must keep both spaces. A minifier that runs a regex over the raw text breaks such values, and the damage only shows up later when a field no longer matches.
This implementation tokenises properly — strings and escapes are tracked — so only structural whitespace is removed. The output is byte-different and semantically identical, which is what makes it safe to minify as a build step.
What minifying does not buy you
With gzip or brotli in front of it, minified JSON is typically only a few percent smaller on the wire, because the compressor already removes the repeated spaces. The real benefit is on parse time and on payloads that travel without compression — a webhook body, a Redis value, an embedded config.
Minifying also destroys readability, diffs and review. Keep the formatted source in version control and minify at build or at send time; minified JSON committed to a repository makes every future change unreviewable.
The failure that looks like success
If the input is not valid JSON, a tolerant minifier can still produce output that looks plausible while having removed something it should have kept — inside a broken string, whitespace is ambiguous. Always parse the result before shipping it: a one-line JSON.parse check catches the whole class of problem.
Copy-paste damage is the usual cause here too. A curly quote or a non-breaking space pasted from a document is not structural whitespace in the JSON sense, and depending on the tokeniser it either survives into the output or breaks the value. Escaping it explicitly is the reliable fix.
How to use
- 1.Paste your JSON
- 2.Click Minify
- 3.Copy the result
How this compares
There are three ways to do this conversion: in the browser (this page), through a server-side converter, or with a desktop app. The useful difference is not speed — it is where your file goes and how far the free tier actually reaches.
| Aspect | This tool | Upload-based converters | Desktop software |
|---|---|---|---|
| Where the file is processed | In your browser, on this page | On the vendor's servers, after an upload | On your own machine, after installing an app |
| Account required | No | Usually — free tiers ask you to sign in before lifting a limit | No, though a licence may be needed |
| Size you can process for free | No size cap, no run limit | A few files per hour, or a ~5–10 MB cap before a paywall | Whatever your disk and RAM allow |
| Price | Free. Pro is $9/month, and only buys larger files and AI features | Usually a subscription — roughly $7–15/month as of November 2026 | A one-off licence, or a subscription |
| Works offline | Yes, once the page has loaded | No | Yes |
| Time before work starts on a 20 MB file | Immediate — there is nothing to upload | Dominated by the upload — about 16 s on a 10 Mbps uplink | Just the app launch |
| What it cannot preserve | Invalid input returns the parser error position instead of a repaired file | The same — the conversion is the same maths | The same, though some desktop apps re-render styles more faithfully |
Server-side converters are genuinely better at some things: very large files, sharing results with a team, keeping a conversion history, and automating batches from a script. For the case in front of you — one file, one format change, right now — they mostly add an upload wait and a sign-up form.
Frequently asked questions
What is JSON minification?
It removes whitespace to shrink the file size.
Does the data change?
No. Only cosmetic whitespace is removed; the data stays identical.
What this kind of conversion cannot keep
Formatters parse the input into a tree and print it back with consistent indentation. If the input is invalid, you get the parser's error position instead of a silently mangled file — malformed JSON stays malformed rather than being «repaired» into something that is no longer yours.
More in Format
On this page
- What is JSON Minifier
- What it does with your file
- How it actually behaves
- How to use it
- How this compares
- FAQ
Excel formula reference
29 functions with syntax, arguments and a table you can retype.
Browse the list →