JSON Tools

JSON Minifier

Strip whitespace from JSON to get the smallest valid output — free, instant and private. Everything runs in your browser; nothing is uploaded.

 

100% in your browser — your data never leaves your device.

How to minify JSON

  1. Paste your JSON into the input box on the left.
  2. It is parsed and re-serialised with no whitespace in the output panel.
  3. If the JSON is invalid, the error message and position appear below so you can fix it first.
  4. Click Copy to put the minified JSON on your clipboard.

Why minify JSON?

Formatted JSON is great for reading, but the extra whitespace adds up over large payloads. Minifying strips it out to produce the smallest valid document, which means quicker transfers and smaller files — without touching the data itself.

Why minify JSON for production

  • Smaller API payloads — every byte you remove from a JSON response is one fewer byte transferred over the network, which adds up across millions of requests.
  • Environment variables & config fields — some platforms impose character limits on environment variable values; minified JSON fits where pretty-printed JSON does not.
  • Embedded config in a bundle — if your build tool inlines a JSON config into JavaScript, starting from minified JSON keeps the bundle smaller from the start.
  • Cache efficiency — smaller payloads are more likely to fit within a CDN cache unit and are cheaper to store and serve.

How much smaller will it get?

The minifier removes all spaces, tabs, newlines, and indentation characters that are not part of a string value. A file formatted with 4-space indentation and many deeply nested objects can shrink noticeably, while a file that was already compact will change very little. The actual saving depends on how much whitespace the original contains — not on the size or complexity of the data itself.

Minify vs gzip

Minifying and compression are two separate steps that work at different levels. Minifying removes redundant characters from the text itself — the resulting file is shorter before any compression is applied. Gzip and Brotli are server-side compression algorithms that then work on that text, encoding repeated patterns even more efficiently. The two approaches stack: minified JSON still compresses well because its structure is repetitive. Minifying is not a substitute for gzip, and gzip is not a reason to skip minifying.

Related tools

Frequently asked questions

Is my JSON uploaded anywhere?
No. Minifying runs locally in your browser with the native JSON parser. Nothing is sent to a server.
What does minifying remove?
All insignificant whitespace — indentation, line breaks and spaces between tokens. The data itself is unchanged, just packed into the smallest valid form.
Why minify JSON?
Smaller JSON means less bandwidth and faster loading. It is handy for API payloads, config embedded in code, and anywhere file size matters.
Is minified JSON still valid?
Yes. Whitespace is not significant in JSON, so a minified document parses exactly the same as its formatted version.
Does minifying change my data?
No. Keys, values, and structure are untouched — only whitespace characters are removed. The resulting JSON is semantically identical to the original.
Could the minifier break my JSON?
It parses the input before minifying, so invalid JSON is reported as an error rather than silently passed through. If the output is produced, it is valid and complete.
Can I expand it again later?
Yes. Paste the minified output into the JSON Formatter to pretty-print it with indentation whenever you need to read or edit it again.
How much space will I save?
It depends on how much whitespace is in the original. A heavily indented file may shrink by 30–50 %; a file that was already compact will barely change.