Guaranteed semantic equivalence
Minification works by parsing and re-serialising, so whitespace inside string values is never touched — only the insignificant whitespace between tokens is removed.
Strip whitespace from JSON to make it as small as possible with this JSON minifier.
Loading tool…
The tool is loading its code on your device. This happens once and is cached for later visits.
Processed entirely on your device
Overview
Minify JSON online — remove indentation, line breaks and unnecessary whitespace without changing a single value. Shows the exact byte saving.
A JSON minifier strips every byte that does not carry meaning. Minification is the JSON equivalent of compilation: same semantics, fewer bytes, worse for humans. A JSON minifier earns its place in three situations — a payload embedded in a length-limited field, a document stored at scale where whitespace adds up, and any JSON crossing a network boundary that cannot compress. For reading, pair it with a formatter; for shipping and storing, the minified form is the correct one.
The numbers make the case quickly. Pretty-printed JSON written with two-space indentation typically shrinks by 20 to 40 percent when you minify it, and deeply nested documents written with four-space or tab indentation can shrink by half. Because this JSON minifier parses and re-serialises rather than running a blind whitespace strip, every one of those saved bytes is guaranteed to be semantically insignificant — and the before and after byte counts are shown, so the JSON compression is a number you can see rather than a guess.
JSON's grammar allows insignificant whitespace in exactly four places: before and after any of the structural characters { } [ ] : ,. That is the entire surface a minifier touches. Everything else — every character between the quotes of a string — is data and must survive byte-for-byte.
This tool parses the document and re-serialises it rather than running a whitespace-stripping regular expression. That distinction is important: a regex approach will corrupt a document containing "message": "a, b\n c", because the spaces and escaped newline inside that string are indistinguishable from formatting whitespace to a pattern that does not understand string boundaries.
If your JSON travels over HTTP with gzip or Brotli enabled — and it almost certainly does — minification saves far less than the raw byte count suggests. Whitespace is extremely compressible: repeated indentation is exactly the kind of redundancy those algorithms excel at. In practice, minified-plus-gzipped and pretty-plus-gzipped are often within a few percent of each other.
Minification still matters when:
Because minification goes through the JavaScript parser, the same big-integer caveat as the formatter applies: numeric literals above 2^53 − 1 will lose precision. If your document contains snowflake IDs or other very large integers, verify the output against the input before relying on it, or handle those fields as strings at the source.
Every mainstream serialiser produces compact JSON by default: JSON.stringify in JavaScript, json.dumps with default separators in Python, Go's encoding/json, Jackson and Gson in the Java world. Pretty-printing is a debugging affordance, not a transport format, and you should never deliberately send indented JSON over the wire. If you capture request and response bodies for logs or replay, keeping the compact form and formatting it on demand is the cheaper habit; the reverse — storing pretty text and re-minifying on every read — wastes both space and cycles.
You can edit it, but you should not enjoy it. A single-line document hides the nesting structure that indentation makes visible, and a JSON minifier is deliberately not an editor. The professional pattern is to keep a readable source, minify a copy for shipping, and reformat whenever a human needs to look. Minified JSON is for machines; formatted JSON is for people; the translation between them should always be one keystroke — which is exactly why the formatter and the minifier exist as a pair.
Because this tool parses before it re-serialises, invalid input produces a positioned error instead of a silently mangled payload. That matters more than it sounds: the classic production incident is a hand-edited document that was whitespace-stripped without validation and shipped with a structural error that no parser caught until runtime. Validation-first minification closes that hole — you can batch-compact a folder of config files and know that any document which fails to minify was already broken before you touched it. Everything happens in your browser, so the payloads you compress, including the ones carrying tokens and internal hostnames, never travel to a server.
Step by step
Paste the pretty-printed JSON you want to compact.
Press Minify; the parser validates first, so broken input is reported rather than mangled.
Compare the input and output byte counts to see the saving.
Copy the minified string, or download it as a compact .json file.
Why use it
What this tool is good for, and what it deliberately does not try to do.
Minification works by parsing and re-serialising, so whitespace inside string values is never touched — only the insignificant whitespace between tokens is removed.
Invalid JSON produces a positioned error instead of a silently broken payload, which is the failure mode that causes production incidents.
Reports bytes before and after, so you can judge whether the compaction is worth it for a given payload.
Configuration fields, URL query parameters, environment variables and embedded-device payloads all have hard length limits that pretty-printed JSON blows through.
Questions
Short, honest answers about quality, limits and privacy.