Como usar esta calculadora
What minification does — and what it does not touch
Minification removes every byte of whitespace between JSON tokens: the indentation, the line breaks, the padding after colons and commas that a formatter added. Whitespace outside string values is insignificant in JSON, so removing it changes nothing about the data — the same values, the same keys, the same order — while making the document as small as the format allows. The tool parses and re-serializes the document rather than editing text, so the output is guaranteed to be valid JSON and semantically identical to the input: the minifier cannot corrupt a document the way a text-based find-and-replace could.
That guarantee is the reason to prefer parse-and-stringify over a clever regex: number representation is preserved, key order is preserved, and the result is always a document the platform can parse again. The savings panel reports input bytes, output bytes, and the percentage saved, so the decision to ship the minified form is made on real numbers.
Where the bytes actually matter
Minification pays off wherever JSON crosses a boundary with a cost: an embedded config in a shipped product (the saving multiplies across every device and every fetch), a payload measured against an API quota, a stored blob billed by size, or a fixture committed to a repository where every byte stays in history. The worked example is typical: a 412-byte pretty-printed config minifies to 301 bytes — 27% smaller, with the same data.
The honest counter-case is also worth knowing: if the input is already compact, re-serialization can add a few bytes (re-escaping a character, for instance), and the tool reports a negative saving rather than hiding it. Minification is a formatting choice with measurable results, and the panel shows the true number in both directions.
The format that travels well
A minified document is still valid JSON, so it can be formatted back to readable indentation at any time — formatting and minifying are exact inverses for valid documents, which is why the JSON formatter and minifier are linked pages. The compact form is also the better base for a second, independent compression step: transport compression (gzip, brotli) works on the bytes after minification, and starting from the smallest valid form means the transport layer has less redundancy to remove.
The two caveats are worth keeping: minification removes whitespace only — it does not rename keys, strip comments (JSON has none), or compress values — and very large documents take a moment to process, so the tool is designed for typical configs and payloads rather than database dumps.
The local promise
Config files and payloads often contain tokens, internal endpoints, and other text that must not leak, and minifying is a job no service needs to see. Everything runs in your browser: the document is parsed and serialized locally, nothing is uploaded, logged, or stored, and copy and download actions deliver the result wherever it is needed.
Perguntas frequentes
A minificação altera meus dados?
Não. O minificador analisa e re-serializa o documento, o que preserva valores, ordem de chaves e representação de números exatamente. Espaços em branco entre tokens são irrelevantes em JSON, então removê-los não causa perdas.
Por que minha saída minificada às vezes é maior?
Se a entrada já é compacta, a re-serialização pode adicionar alguns bytes (por exemplo, ao re-escapar caracteres). O percentual de economia pode ser negativo nessas entradas — a ferramenta informa os números reais em vez de escondê-los.
O JSON minificado pode ser formatado de volta?
Sim — a forma minificada é JSON válido, então o formatador de JSON restaura a indentação legível a qualquer momento. Formatar e minificar são operações exatamente inversas para documentos válidos.
Does the minifier remove comments?
JSON has no comments — a document containing them is not valid JSON and is rejected with the parser’s error. Files like tsconfig or package.json use JSONC or JSON5 variants that allow comments; those are outside the JSON standard this tool follows.
Why is the savings percentage negative sometimes?
When the input is already compact, re-serialization can add a few bytes — for example re-escaping a character or normalizing a number’s formatting. The tool reports the true change rather than a floor of zero.