How to minify JSON
- Paste your JSON into Input.
- The minified JSON appears right away, and the status line shows how many characters were removed. Turn on Sort keys to order keys alphabetically as well.
- Copy the single line or download it as minified.json.
What else changes
The JSON is read and written out again rather than edited in place, so a few things are normalized along the way:
| Input | Output |
|---|---|
1.0 |
1 |
1e3 |
1000 |
"caf\u00e9" |
"café" |
{"a": 1, "a": 2} |
{"a":2} |
All of these mean the same thing to a JSON parser, except duplicate keys: only the last value is kept, which is also what many parsers do when they read the file.
How much smaller it gets
It depends on how the JSON was indented. Pretty-printed JSON with deep nesting carries a lot of indentation, so it shrinks more than a flat list of short values. If the JSON is sent over HTTP with gzip or Brotli, the saving after compression is smaller than the character count suggests, because whitespace compresses well.