Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

JSON Minifier — Minify JSON Online

Remove all unnecessary whitespace from JSON, validate it at the same time and see exactly how many bytes you save — before and after gzip.

Atualizado em
Open file

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como usar: JSON Minifier

  1. Paste JSON or open a .json file.
  2. The JSON is validated and minified instantly; errors show the line and column.
  3. Optionally sort keys alphabetically or write each array item on its own line (NDJSON).
  4. Copy or download the minified JSON.

What is JSON minification?

Minifying JSON removes every space, tab and line break that is not inside a string. The data is unchanged — JSON.parse returns exactly the same object — but the text is smaller. Pretty-printed JSON with two-space indentation is often 20–40 % larger than its minified form.

{
  "id": 42,
  "tags": ["a", "b"]
}

becomes {"id":42,"tags":["a","b"]}.

When to minify JSON

  • API responses and config shipped to browsers — fewer bytes over the network.
  • Storing JSON in databases, Redis, cookies, environment variables or query strings where size limits apply.
  • Embedding JSON-LD or app state in HTML.

For files you edit by hand, keep the formatted version in your repository and minify during the build. Use the JSON formatter to turn minified JSON back into readable form.

Minified vs gzipped size

Gzip and Brotli are very good at compressing repeated whitespace, so after HTTP compression the difference between formatted and minified JSON shrinks to a few percent. The stats show both numbers so you can judge whether minifying is worth it for your case. For big payloads, removing unused fields and shortening repeated keys saves far more.

Sort keys and JSON Lines

OptionUse it for
Sort keysStable output for diffs, caching keys and signatures — two objects with the same data produce identical text
JSON LinesLog files, BigQuery and Elasticsearch bulk imports, streaming — one JSON value per line

Validation

Because the JSON is parsed before it is minified, the tool doubles as a validator: trailing commas, single quotes, comments and unquoted keys are reported with their position. Large numbers keep JavaScript’s precision limits — integers above 253 may lose digits.

Também pesquisado como: minify json, json compressor, compress json, json one line, remove whitespace json, json to ndjson, json lines.

Ferramentas que combinam com: JSON Minifier

  • JavaScript Minifier — Paste JavaScript and get production-ready minified code from Terser — the same engine used by Vite, webpack and Rollup — with real before/after and gzipped sizes.
  • Gzip Compress & Decompress — Compress text or any file with gzip, zlib or raw deflate — or paste Base64 / open a .gz file to decompress it.
  • JSON to CSV — Turn a JSON array into a spreadsheet-ready CSV.
  • XML Minifier — Compact XML documents, feeds, sitemaps and SOAP payloads by removing indentation and comments — with a well-formedness check so nothing breaks.

Perguntas frequentes

Does minifying JSON change the data?
No. Only whitespace outside strings is removed. Parsing the minified JSON gives exactly the same values.
How do I convert JSON to one line?
Paste it here — the minified output is a single line. Copy it or download it as a file.
Why is the gzipped size so close for formatted and minified JSON?
Gzip and Brotli compress repeated whitespace extremely well. Minifying still helps when data is not compressed, for example in databases, cookies or URLs.
Is my JSON uploaded?
No. Validation and minification run in your browser.
Posso instalar o JSON Minifier como um aplicativo da web e usá-lo offline?
Sim. O JSON Minifier é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas