JSON Minifier
Remove every unnecessary space and line break from JSON — values stay exactly the same.
- Original
- 230 B
- Minified
- 156 B
- Saved
- 74 B (32.2%)
JSON input
Tab inserts indentation. Press Escape, then Tab, to move focus out of the editor.
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.
Related 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.