JSON Minifier
This JSON minifier removes every unnecessary space and line break — values stay exactly the same.
- Original
- 230 B
- Minified
- 156 B
- Saved
- 74 B (32.2%)
JSON input
Minified JSON
How to minify JSON
- Paste formatted JSON on the left, or open or drop a .json file.
- The minified JSON appears on the right, with original size, new size and savings above.
- Copy it or Download it as a .json file.
Compress JSON without changing it
Minifying removes every character a JSON parser doesn't need: indentation, line breaks and the spaces after colons and commas. Spaces inside strings are data, so they stay — and so does everything else. The minifier also validates the JSON first, so you never ship a broken file.
{
"id": 42,
"name": "Ada Lovelace",
"tags": ["math", "code"]
}{"id":42,"name":"Ada Lovelace","tags":["math","code"]}When to minify JSON
- API responses and request bodies, to save bandwidth at scale.
- JSON embedded in HTML, JavaScript bundles or environment variables.
- Large data files stored or cached in bulk.
- Storing JSON in a database column or message queue.
Compress JSON: minify first, then gzip
Minifying is the first step to compress JSON: it removes whitespace that parsers ignore. Servers then usually compress the response with gzip or Brotli, which shrinks repeated keys and values much further. Both together give the smallest transfer — and the minified file stays valid JSON that any program can read without unpacking it.
The JSON minifier never rewrites your values. Numbers and escapes stay as written:
{
"n": 12345678901234567890,
"s": "caf\u00e9 \"q\"",
"x": 1.50
}
→ {"n":12345678901234567890,"s":"caf\u00e9 \"q\"","x":1.50}That matters for IDs larger than JavaScript can represent exactly and for prices like 1.50, which a JSON compressor that re-serialises the data would change to 1.5 or round.
Other JSON tools
Need it readable again? The JSON formatter reverses minification. If the minifier reports an error, the JSON validator explains it and can repair common mistakes. The same idea for markup: the XML minifier and the HTML minifier.
Frequently asked questions
- What does minifying JSON remove?
- All whitespace outside of strings: indentation, line breaks and spaces after colons and commas. Text inside strings, numbers and key order are not changed.
- How much smaller does JSON get?
- Typically 10–40% for pretty-printed JSON, depending on indentation and nesting depth. The tool shows the original size, the minified size and the percentage saved.
- Should I minify JSON for APIs?
- For responses and payloads that machines read, yes: it saves bandwidth, and it adds up at scale. Server compression (gzip or Brotli) still helps on top. Keep a formatted copy for people to read.
- Can I undo minification?
- Yes. Paste the minified JSON into the JSON formatter to pretty-print it again — no information is lost.
- Is a JSON minifier the same as a JSON compressor?
- Minifying removes whitespace and keeps a valid, readable-by-machines JSON file. Compression such as gzip or Brotli encodes the bytes and must be unpacked before use. For APIs, minify the JSON and let the web server compress the response.