JSON Minifier

Strip all whitespace from JSON in one click. Ideal for API payloads, JWT tokens, and localStorage. Zero upload — runs entirely in your browser.

INPUTUTF-8 / JSON

Why minify JSON?

Every space, tab, and newline you add for readability is an extra byte your network has to carry. For a 10 kB configuration file, that's nothing. For a 2 MB API response hitting thousands of mobile clients, the whitespace alone can add hundreds of kilobytes.

Minification is especially impactful in contexts where HTTP compression is unavailable: JWT payloads (base64-encoded, no compression), localStorage and sessionStorage (plain text), URL-encoded query parameters, and embedded JSON in HTML data attributes.

Typical savings

Minifying a pretty-printed JSON document typically removes 20–45% of bytes. Combined with gzip, total reduction can reach 80–95% compared to un-minified, un-compressed JSON.

Privacy first

All processing happens locally in this browser tab. Your data never leaves your device. No server, no log, no tracking of your payload.

Common questions

What does JSON minification do?
Minification removes all whitespace (spaces, tabs, newlines) that is not inside a string value. The resulting JSON is semantically identical — every parser produces the exact same data structure — but uses fewer bytes.
When should I minify JSON?
Minify when size matters and compression is unavailable: JWT payloads, localStorage / IndexedDB storage, URL-encoded state, embedded JSON in HTML attributes, and any API where gzip is disabled. For most HTTP APIs, gzip already compresses whitespace efficiently, so minifying first gives diminishing returns.
Is minified JSON still valid?
Yes. Whitespace between tokens is optional in the JSON grammar (RFC 8259). A minified document is 100% valid and parses identically to its pretty-printed version.
What is the difference between minify and compress?
Minification removes optional whitespace from the JSON text itself. Compression (gzip, Brotli, zstd) encodes the resulting byte stream using entropy coding. They are complementary: minify first, then compress for maximum reduction.
How private is this tool?
All processing happens locally in your browser using the native JSON.parse / JSON.stringify. Your data never leaves your device. Open the network panel — you will see zero requests when you click Minify.
My minified JSON looks wrong — why?
If the output differs from what you expect, check that the input is valid first. JSON.parse normalises some edge cases: for example, it removes duplicate keys (keeping the last one), and discards any trailing content after the first valid value.