JSON Minifier

Minify JSON in your browser — strip whitespace to the smallest valid JSON and see the size saved.

100% Browser-Based Local Processing
Also
JSON
Minified

Waiting for JSON Original 0 B Output 0 B Saved 0%

Privacy Focused

🔒 Local Processing. Your code never leaves your device.

Instant Results

🌐 Fully Client-Side. Runs instantly in your browser.

No Signup

⚡ No accounts. No API keys. Just open and use.

Browser Based

🚀 No installs, no CLI, no build step.

Shrink your JSON — losslessly and privately

A JSON Minifier removes all insignificant whitespace — indentation, line breaks, and spaces between tokens — to produce the smallest valid JSON. The result is byte-for-byte smaller but parses to the identical data. This one runs entirely in your browser, so your JSON is never uploaded.

Pretty-printed JSON is great for reading but wasteful for transport and storage — all that indentation and line-breaking is bytes you don't need to send. A JSON minifier strips out every bit of insignificant whitespace, collapsing the JSON onto a single compact line while keeping it completely valid and equivalent.

Paste your JSON, open a local file, or drop one on the left pane, and the tool validates it, minifies it, and shows the size before and after in real bytes — UTF-8 bytes, not characters, so an accented word or an emoji counts what a file would actually cost — with the percentage saved. The output parses to exactly the same object — same keys, same values, same order — so it's a lossless transformation; only whitespace between tokens is removed. Whitespace inside your string values is untouched. You can copy, download, or flip back to beautify if you need it readable again.

Privacy comes first, as with every tool here. Minifying happens in your browserno server, no upload, no logging, no tracking. Developers minify API payloads and config files they'd rather not send anywhere; here the JSON never leaves your device, and the tool works offline once loaded.

A couple of honest notes. Because it validates first, it won't emit broken JSON — an invalid document is reported with the line and column, not mangled. Comments and trailing commas are the exception, and they are common enough in a config file to be worth a switch: turn on Strip comments and JSONC goes in, standard JSON comes out. The stripper reads the document character by character, so a // inside a string — every URL you have ever pasted — is left alone.

And on savings: minifying meaningfully reduces size, but for network transport, server compression (gzip or brotli) usually saves more than minifying alone — the good news is they stack, so minified-then-compressed is smaller still. Minifying is most valuable where compression isn't applied, or to keep payloads lean by default. Sort keys A–Z is the other switch: it reorders every object by key, which is what makes two API responses diffable when the server returns them in whatever order it likes.

The JSON Minifier in dark mode: a commented JSONC config in the cyan JSON pane on the left with Strip comments turned on, the minified single line in the magenta Minified pane on the right, and a stat line reading Original 321 B, Output 214 B, Saved 33%
The stat line counts UTF-8 bytes, which is what the file costs — not characters

For the reverse, see the JSON Formatter; to check validity, the JSON Validator.

When a JSON minifier helps

  • Shrinking payloads. Trim API request/response bodies.
  • Config & embeds. Compact JSON stored inline or in attributes.
  • Saving space. Reduce JSON kept in databases or files.
  • Clean diffs of size. See exactly how many bytes you save.
  • Sensitive data. Minify private JSON without uploading it.

How to minify JSON

Paste or load your JSON

Type it, paste it, or open a local file (read in-browser, not uploaded).

Minify

There is no Minify button: the tool validates and minifies on every keystroke, and the right pane holds the result. The Minified and Beautified segment at the top decides which form you get — the same data either way.

Check the size saved

The stat line shows the original and the output in UTF-8 bytes and the percentage saved. Bytes rather than characters matters the moment your JSON is not pure ASCII: é is two bytes, an emoji is four, and a payload of Japanese text is about three times its character count.

Copy or download

Grab the minified output — it's still valid JSON.

Beautify anytime

Switch the segment to Beautified for two-space indentation and read it again; switch back and it is one line. Nothing is sent anywhere either way. Sort keys A–Z can be left on through both, which is the quickest way to make two responses from the same endpoint comparable.

The same JSON with the segment switched to Beautified: the right pane shows two-space indented JSON with keys, strings, numbers and the literal true in different colours, and the stat line now reads Saved 0%
Beautified is the same data at 0% saved — the segment decides the shape, not the content
Realistic example

A prettily-indented 2 KB config might minify to around 1.3 KB — roughly a third smaller — while parsing to the exact same object. The tool shows the precise saving for your file.

Advanced tip

If this JSON travels over HTTP, enabling gzip/brotli on your server usually saves more than minifying; do both for the smallest transfer.

Common mistake to avoid

Watch which switches are on. Strip comments silently changes what is parsed, and Sort keys A–Z silently changes the output's key order — both are what you want when you want them and neither announces itself in the result. If a minified file does not match what a colleague produced from the same input, the switches are the first thing to check.

Related

To read minified JSON again, use the JSON Formatter.

What to keep in mind

  • Zero-knowledge and private. Minifying runs in your browser — nothing uploaded, logged, or tracked, and it works offline.
  • Lossless and equivalent. Only whitespace between tokens is removed; the parsed data is identical, and string contents are preserved.
  • Validates first. Invalid JSON is reported, not silently minified into something broken.
  • Gzip usually saves more. For transport, server compression beats minifying alone — but they stack.
  • Large files run locally. Very big JSON is limited by your device, since there's no server.

Frequently Asked Questions

The JSON Minifier on a 390-pixel phone: the Minified and Beautified segment and the two switches stacked across the top, a tab strip switching between the JSON and Output panes, and the minified result wrapping inside the pane rather than scrolling sideways
On a phone the two panes become a tab strip, and the minified line wraps instead of scrolling
How do I minify JSON?

Paste your JSON (or load a local file) and the tool validates it, then removes all insignificant whitespace — indentation, line breaks, and spaces between tokens — collapsing it to one compact line. It shows the size before and after so you can see the saving. Then copy or download the minified JSON. Everything happens in your browser; nothing is uploaded.

Does minifying change my JSON or its data?

No. Minifying is lossless: it only strips whitespace between tokens, so the result parses to exactly the same object — same keys, same values, same order. Whitespace inside your string values is preserved, because that's meaningful data. The minified JSON is byte-for-byte smaller but semantically identical to the original, and you can beautify it back anytime.

Does this upload my JSON, and does it work offline?

No upload, and yes it works offline. All processing happens in your browser using JavaScript — there's no server receiving your data, no logging, and no tracking. That makes it safe for private API payloads and configs. Once the page has loaded it keeps working with no internet connection, which you can confirm in your browser's network tab.

How much smaller does minifying make JSON?

It depends on how much whitespace the original had. Heavily indented, pretty-printed JSON often shrinks by roughly 20–40%, since indentation and line breaks add up. Already-compact JSON saves little. The tool reports the exact bytes and percentage for your file, so you can see the real saving rather than guess.

Is minified JSON still valid?
The minifier on an invalid document: the right pane reads Nothing to show until the JSON parses, the status pill reads Invalid JSON, and the error panel underneath reads line 4, column 3 beside Expected double-quoted property name, and 2 problems on the right
A parse error with the line and column, and a second line when the document looks like JSONC

Yes. Whitespace between tokens is insignificant in JSON, so removing it leaves fully valid JSON that any parser reads identically. The tool validates your input before minifying, so it only ever outputs valid, equivalent JSON. If your input isn't valid, it reports the error instead of producing broken output.

What's the difference between minifying and gzip compression?

Minifying removes whitespace from the text itself, making the JSON smaller before anything else touches it. Gzip/brotli is compression applied by your server (or a tool) during transfer, which finds and removes redundancy far more aggressively. For network transport, gzip usually saves more than minifying alone — but they stack: minify then compress for the smallest result. Minifying is most useful where compression isn't applied.

Does it remove whitespace inside my string values?

No. Only insignificant whitespace — the spaces, tabs, and newlines between tokens (keys, values, brackets) — is removed. Whitespace inside a string value, like "hello world" or a formatted address, is part of the data and is kept exactly. Minifying never alters the contents of your strings; it only tightens the structure around them.

What happens if my JSON is invalid?

The tool validates before minifying, so if your JSON is malformed it reports the error with the line and column — the parser reports a character offset, which is no help in a 400-line file — instead of producing broken or partial output. Comments and trailing commas have a switch of their own — turn on Strip comments and they are removed before parsing — and the panel says so when it sees them. The other common causes are single quotes, unclosed brackets. Fix the reported issue — or use the JSON Formatter to find it — and then minify.

Can I reverse it — beautify the JSON again?

Yes. Minifying only removes whitespace, so you can expand it back into readable, indented JSON at any time — the data is identical either way. Use the beautify option here, or the dedicated JSON Formatter to pretty-print with your chosen indentation. Note that minifying doesn't preserve original formatting; beautifying re-indents from scratch.

Can I load a file instead of pasting?

Yes. You can open a local .json file and the tool reads it directly in your browser with the FileReader API — the contents load into the editor without being uploaded anywhere. This is handy for large files or ones you'd rather not copy and paste, and it's exactly as private as pasting the JSON by hand.

Can it minify very large JSON?

Usually yes. Because it runs locally, the limit is your device's memory and CPU rather than a server cap, and modern browsers handle multi-megabyte JSON well. Very large files (tens of MB) can be slow to parse, but there's no upload size limit from us and nothing is sent anywhere — it's purely a matter of local performance.

Is it free, and are there limits?

Yes, completely free — no payment, no signup, no account, and no usage caps or watermarks. Since everything runs in your browser, there's nothing for us to meter; the only practical limit is your device's performance on very large files. Use it as much as you like, including offline once the page has loaded.

Still have questions?

If you can't find the answer you're looking for, feel free to contact our support team.

Contact Us