JSON Minifier
Compress JSON to the smallest valid form by stripping whitespace, and see exactly how many bytes and what percentage you saved. Lossless and fully browser-based.
Tip: click Repair to auto-fix trailing commas, single quotes, unquoted keys and comments.
About this JSON
Session History
Formatted JSON from this session will appear here.
History is kept only in your browser memory for this session and is cleared when you refresh or close the page. Nothing is stored or uploaded.
Minification is lossless and runs locally in your browser — your JSON is never uploaded. Note that gzip/brotli compression on most servers already removes whitespace in transit.
What It Does
This tool turns readable, indented JSON into the most compact valid JSON possible by removing every byte of insignificant whitespace — the newlines, indentation and spaces between tokens — while leaving your data completely intact. It validates the JSON as it minifies, so if the input is broken it tells you exactly where, and it can repair the common mistakes in one click. The headline feature is the savings report: it shows the original size, the minified size, and the precise percentage you saved, so you can see the real benefit for your document rather than guessing. Because minification is lossless, you can always pretty-print the result again later. Everything runs locally in your browser, so even large payloads never leave your machine.
When to Use It
- You are embedding JSON in an HTML data attribute, a JavaScript bundle, or a QR code and need it as small as possible.
- You are storing JSON in a database column or cache and want to cut its footprint without losing any data.
- You want to measure how much whitespace a pretty-printed payload is actually carrying before you decide whether minifying is worth it.
- You need to paste a compact one-line version of a config or response into a ticket, a script, or a command.
Worked Examples
{
"name": "Ada",
"skills": [
"json",
"js"
],
"active": true
}
A pretty-printed object. Minified it collapses to one line and the savings panel shows the bytes removed and the percentage saved.
{"already":"compact","x":1}
Already minified. The tool notes there was little or nothing to strip, so the savings are near zero.
{
"nested": { "a": { "b": { "c": [1, 2, 3] } } }
}
Deeply nested JSON carries whitespace on every level, so minifying it yields a noticeably larger percentage saving.
Features
How to Use
1. Paste or type your JSON. 2. The minified, single-line output appears instantly. 3. Check the savings panel for the before and after sizes and the percentage saved. 4. If the input is invalid, fix it or click Repair. 5. Use Copy or Download to take the compact result.
Common Mistakes
- Expecting huge savings on top of gzip. Most servers already compress responses, so minifying mainly helps where compression is absent (embedded JSON, storage).
- Minifying JSON you still need to read. Keep a pretty-printed copy for debugging — the minified form is for machines.
- Assuming minified JSON is somehow protected. It is exactly the same data, just without spaces; it offers no security or obfuscation.
- Minifying invalid JSON and shipping it. Always confirm it validates first — this tool checks as it minifies and can repair common errors.