AnyFormat

00 Utility

JSON Minifier

Whitespace out, byte count shown before and after.

01Input
02Output
03Options 2
  • No upload The conversion runs in this tab. Your file never travels — not to us, and not to the advertising.
  • No sign-up, no email, no daily cap There is no account system to sign up to.
  • No size limit we invented Only your device's memory — about ~2 GB on a desktop browser, ~400 MB on a phone.
  • Turn your Wi-Fi off and convert anyway The conversion needs nothing but this page. Ads will not load without a connection; your file will still convert. That is the whole claim, and it takes five seconds to check.

Removes every byte of insignificant whitespace and reports the saving. Useful for fitting a payload into a size-limited field — a URL parameter, a database column, an environment variable, a QR code.

How much this actually saves

Formatted JSON is typically 15–30% whitespace, and deeply nested documents are worse. The exact number for your document is shown after every conversion.

Over HTTP most of that saving disappears: gzip and brotli compress repeated indentation almost to nothing, so a minified payload is often only a few per cent smaller on the wire. Where minifying genuinely matters is anywhere the raw bytes are counted — a 2,048-character URL limit, a fixed-width column, a device with a small message budget.

What is preserved

Whitespace inside string values is untouched — only whitespace between tokens is removed. Key order is preserved unless you ask for sorting. Numbers are re-serialised, so 1.50 becomes 1.5 and 1e3 becomes 1000: the values are identical but the text is not, which matters if you are comparing checksums.

Minifying is not compressing, and the difference is larger than it looks

Stripping whitespace typically takes 10 to 20 percent off a formatted JSON file. Gzip, which every web server and every HTTP client already speaks, takes 80 to 90 percent off the same file — and it is very good at repeated whitespace specifically, so minifying first adds only a few percent to what gzip alone achieves. If the goal is a smaller response over the network, transfer compression is the whole answer and this tool is a rounding error. Where minifying does earn its place is a payload with no compression in front of it: a query string, an embedded data attribute, a size-capped log line.

Other names for this

Also searched as “compress json”, “json compactor”, “minify json online”.

Questions

Will minifying break anything?
No. Whitespace between tokens carries no meaning in JSON, and whitespace inside strings is left exactly as it was.
Why did my number change?
Numbers are re-serialised in their shortest exact form: 1.50 becomes 1.5. The value is unchanged, but the bytes are not, so checksums will differ.
Does my text leave the browser?
No. Everything runs as JavaScript in this tab — there is no server involved and no request is made. Open the Network panel and watch, or turn your Wi-Fi off and keep using the tool.