Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

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.

Mis à jour le
Open file

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : 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.

Aussi recherché comme : minify json, json compressor, compress json, json one line, remove whitespace json, json to ndjson, json lines.

Outils complémentaires : 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.

Questions fréquentes

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.
Puis-je installer JSON Minifier en tant qu’application web et l’utiliser hors ligne ?
Oui. JSON Minifier est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires