Developer Tools

JSON Minifier

Compress JSON to a single line by stripping every optional space and line break — with a live size readout and one-click un-minify.

100% browser-side processing — nothing is uploaded

Minify: Strip whitespace for the smallest payload. Output updates live as you type — or press Ctrl/Cmd + Enter.

Results update live as you type.
14 lines · 0.29 KB
1 lines · 0.00 KB

Related tools

How to minify JSON

  • Paste JSON

    Drop formatted or hand-written JSON into the editor.

  • Minify

    The output collapses to a single line with all optional whitespace removed. The status line shows the size.

  • Copy or revert

    Copy the compact payload, or switch to Format to expand it back to readable form.

What minification actually removes

JSON permits whitespace between tokens purely for human readability — indentation, line breaks, spaces after colons and commas. Minification parses the document and re-serializes it with none of that, producing the smallest byte-identical-in-meaning representation. String contents are untouched: spaces inside values are data, not formatting. A typical pretty-printed API fixture shrinks by 25–40%, more when nesting is deep.

When minifying matters — and when gzip already did it

Over the wire, most servers gzip or brotli-compress responses, and compression algorithms flatten repeated whitespace almost for free — so minifying rarely changes transfer size much on a compressed connection. Minification earns its keep elsewhere: payloads embedded in a curl command or environment variable, JSON stuffed into a query string or HTTP header, storage systems that bill raw bytes, and log lines where one record per line is a hard requirement. It is about the contexts where the whitespace itself is in the way.

JSON Minifier FAQ

Does minifying lose any data?

No. Only whitespace outside of string values is removed. The minified document parses to exactly the same data as the original — formatting it again restores full readability.

How much smaller will my JSON get?

It depends on indentation depth. A 2-space pretty-printed payload typically shrinks 25–40%. The editor shows input size and the status line reports output size so you can see the exact saving.

Should I minify API responses?

Usually your web server’s gzip/brotli compression already neutralizes whitespace over the wire. Minify when the raw byte count matters: embedded payloads, headers, query strings, storage quotas, or single-line log formats.

Can I undo minification?

Yes — switch to the Format action (or use the formatter tool) and the same data expands back with clean indentation. Minification is fully reversible because no data is removed.

Is the JSON processed locally?

Yes. Minification runs in your browser; nothing is uploaded or stored.