JSON Minifier
Strip whitespace to make JSON as small as possible.
How to use the JSON Minifier
- Paste your formatted JSON.
- Copy the minified, single-line output.
About the JSON Minifier
Minifying JSON removes every byte a machine does not need: the newlines, the indentation, the space after each colon. The data itself is untouched — parse the minified output and you get exactly the same structure back — so the only win is bytes over the wire. It is the mirror image of the JSON formatter.
Be realistic about the size saving. Whitespace compresses extremely well, so if your API already serves responses with gzip or Brotli — most do — minifying first saves far less than the raw character count suggests. Where it genuinely earns its keep is anywhere without transparent compression: a value stored in a database column, a config blob in an environment variable, a payload embedded in a URL, or anything squeezed under a message-size limit.
This tool parses your JSON before re-emitting it, which means broken input is rejected with an error rather than silently mangled — no comments, no trailing commas, no single-quoted keys, since none of those are legal JSON. Parsing also means the output is normalised rather than merely stripped: number literals are re-printed canonically, so 1.50 becomes 1.5 and 1e2 becomes 100, and a duplicated key collapses to its last occurrence. It all runs in your browser, so nothing is uploaded.
Frequently asked questions
Will minifying change my data?
Not the data — parse the output and you get an identical structure. The text does change beyond whitespace, though: numbers are re-printed in canonical form, so 1.50 becomes 1.5 and 1e2 becomes 100. If you need the original bytes preserved exactly, do not round-trip through a parser.
Is it worth minifying if my server already uses gzip?
Usually only a little. Repeated whitespace is exactly what compression algorithms are best at, so most of the saving is already being made for you. Minifying matters most where nothing compresses the payload — database fields, env vars, URLs, message-size caps.
Does this actually compress the JSON?
No. It removes insignificant whitespace only. There is no compression algorithm involved, and the result is still plain readable JSON, just on one line.
Can I get my formatted version back?
Yes — minifying is reversible because nothing meaningful was thrown away. Paste the output into the JSON formatter and choose your indent. The original spacing choices are gone, but the structure is identical.
Why does it reject my file?
Because it validates as it minifies. Comments, trailing commas, unquoted keys and single-quoted strings are all common in hand-written config but none of them are valid JSON. The error message points at the offending spot.

