JSON Minifier

Strip every byte that is not data, and see precisely what you saved.

Input
Output
size nodes depth integers beyond 2⁵³

About this tool

Minification removes every byte of a JSON document that is not data: indentation, line breaks, and the spaces after colons and commas. The result is the smallest valid JSON with exactly the same content.

The readout under the output states the size change plainly — 4.2 KB → 1.8 KB (57% smaller) — because that number is the entire reason you are here.

If your input has comments (JSONC, like tsconfig.json), the Comments control decides whether to strip them or keep them; minified JSON with kept comments is no longer strictly JSON, so the default is strip.

How to use it

  1. Paste your JSON. Minification happens live — the tool starts in Minify mode.
  2. Check the size delta in the readout: input size, output size, percentage saved.
  3. Copy or download. The download is named data.min.json so it sits next to your original without overwriting it.

Worked example

A pretty-printed response of 4.2 KB minifies to 1.8 KB — 57% smaller — with the readout confirming it. The two documents are the same data.

// pretty
{
  "status": "ok",
  "items": [
    { "id": 1, "name": "first" },
    { "id": 2, "name": "second" }
  ]
}
// minified
{"status":"ok","items":[{"id":1,"name":"first"},{"id":2,"name":"second"}]}

Before and after

Frequently asked questions

How much smaller does minified JSON get?
For typical pretty-printed API responses, 40–70%. The exact number depends on how much of the file was indentation. The readout shows the real figure for your document, computed from the actual byte sizes in UTF-8.
Does minification change my data?
No. Only whitespace outside strings is removed. Values, keys, key order, and the exact digits of large integers all survive byte-for-byte. Nothing inside a string is touched — a space inside a string value is data, not whitespace.
Is minified JSON still valid JSON?
Yes — unless you choose to keep comments in a JSONC file, which no minifier can make valid JSON. Whitespace between tokens is optional everywhere in the grammar, which is exactly why it can be removed.
Should I minify JSON I serve from my API?
Usually compression (gzip or brotli) at the transport layer saves more and costs nothing, and most clients pretty-print when they need to read it. Minified JSON mainly helps when the file is stored or transferred as-is: bundled fixtures, config artifacts, anything a consumer downloads directly.
It says my integers are kept exact. What does that mean?
Minifying a document containing an id like 1234567890123456789 keeps every digit. Tools that round-trip through a JavaScript number would silently turn it into 1234567890123456800. Same document, one fewer zero of correctness.