About the JSON Minifier
Remove all unnecessary whitespace from JSON to make it as small as possible for APIs, config files and storage. The tool shows the size before and after.
Key features
- Removes every unnecessary space, tab and line break
- Validates while minifying, so broken JSON is never output
- Shows the size before and after, plus the % saved
- Preserves values, key order and number precision
- Handles large files instantly
- Download the result as a .json file
What is JSON minification?
Minifying JSON removes all the whitespace that only exists to help humans read it: indentation, line breaks and spaces after colons and commas. The result is a single compact line that machines parse just as easily, but that takes fewer bytes to store and transmit.
{
"id": 7,
"tags": ["a", "b"]
}
becomes
{"id":7,"tags":["a","b"]}
Why minify JSON?
- Faster APIs. Smaller payloads mean less bandwidth and quicker responses, especially on mobile networks.
- Lower storage costs. Logs, queues and document databases store fewer bytes.
- Embedding. Single-line JSON fits into environment variables, HTTP headers, URL parameters and CSV cells.
- Bundle size. Static JSON shipped with a web app (translations, configs) loads faster.
How much will I save?
| Original formatting | Typical saving |
|---|---|
| 4-space indentation, deeply nested | 30–40% |
| 2-space indentation | 15–25% |
| Already compact with a few line breaks | Under 5% |
The tool shows the exact numbers for your data under the output panel.
Minifying vs. compressing
Minifying and compression (gzip, Brotli) work well together. Compression removes repetition; minification removes whitespace that compression would otherwise have to encode. For JSON served over HTTP, do both. For JSON stored at rest, minifying alone often gives most of the benefit at no CPU cost.
Things minification doesn't do
- It doesn't shorten keys or values.
"customerIdentifier"stays as it is. - It doesn't remove
nullor empty values. Use the JSON Cleaner for that. - It doesn't fix invalid JSON. Repair it first with the JSON Fixer.
Related tools
To go the other way, the JSON Formatter pretty-prints minified JSON. The JSON to One Line tool produces the same compact output, labelled for log and CLI use.
How to use the JSON Minifier
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The result appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.