JSON Minifier
Minify JSON by removing all unnecessary whitespace and line breaks. See how many characters you save, and get clear errors for invalid JSON.
Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.
How to use the JSON Minifier
- 1 Paste the JSON you want to compress.
- 2 The minified version appears right away, with the size reduction.
- 3 Copy it or download it as a file.
About the JSON Minifier
Minifying JSON removes every space, tab and line break that is only there for readability. The data stays exactly the same, but it takes fewer bytes, which matters for API payloads, configuration embedded in other files, local storage limits and log lines.
The minifier parses your JSON with the browser's parser and writes it out again without whitespace. Because the text is parsed first, it doubles as a validator: invalid JSON gives an error with the line and column instead of a broken result.
Whitespace inside strings is kept, since it is part of the data. Expect savings of 10–30% for typical formatted JSON; deeply indented documents can shrink by half. For transfer over the network, gzip or Brotli compression gives much larger savings, and works best on top of minified data.
Frequently asked questions
Is minified JSON still valid JSON?
Yes. Whitespace between tokens is optional in JSON, so the minified version is equivalent to the original and any parser reads it the same way.
Can I turn minified JSON back into readable JSON?
Yes, use the JSON formatter. Only whitespace was removed, so formatting restores a readable layout.
Does minifying change numbers?
Numbers are written the way JavaScript represents them, so 1.0 becomes 1 and 1e3 becomes 1000. The value is the same. Very long numbers beyond JavaScript's precision can lose their last digits.
Should I minify JSON before sending it?
For APIs it usually helps a little; HTTP compression (gzip, Brotli) helps much more. For files people edit, keep them formatted and let a build step minify them.