JSON Minifier

Strip every optional space, tab, and newline to shrink JSON to the smallest valid single-line payload — typically 10–30% smaller. Minification runs entirely in your browser as you type and never changes your data, keys, or structure.

Quick answer

Minifying JSON removes every optional whitespace character — the spaces, tabs, and newlines between tokens — leaving valid JSON on a single line. The data, keys, order, and structure are untouched; only presentation changes. It runs entirely in your browser via JSON.parse() then JSON.stringify(), so nothing is uploaded. Paste JSON, click Minify, then copy or download.

How JSON Minification Works

When to Minify JSON

Worked example

The same object formatted and then minified — notice that only whitespace disappears:

Input (formatted)

{
  "name": "Alice",
  "roles": ["admin", "editor"],
  "active": true
}

Output (minified)

{"name":"Alice","roles":["admin","editor"],"active":true}

What happened

Edge cases & gotchas

Frequently Asked Questions

Will minifying JSON change the data?

No. Minification only removes whitespace and formatting characters, it does not change the JSON values.

Can I undo minification?

Yes. Paste the minified JSON into the formatter page to restore readable indentation.

Is minified JSON good for production?

Yes. Minified JSON is ideal for production because it reduces payload size and improves transfer speed.

Should I minify JSON during development?

No — keep JSON formatted and readable during development so you can inspect and debug it easily. Minify only as part of your build or deploy step before shipping to production.

Does minifying JSON make it invalid?

No. Minified JSON is always valid JSON as long as the input was valid. Whitespace between tokens is optional according to the JSON specification — removing it does not affect any parser.

Is minifying better than gzip for reducing size?

No — they do different jobs, and gzip does far more. Minifying only removes optional whitespace, usually saving 10–30%. Server-level gzip or brotli compression, which most web servers and CDNs enable, typically shrinks JSON by 70–90% because it also compresses repeated keys and values. The best result is to minify and enable gzip; once gzip is on, minification alone adds only a small extra saving over the wire.

Can minifying change my numbers?

Slightly, in representation only, never in value. Because this tool parses then re-serializes, numbers are normalized to their canonical form — 1.0 becomes 1, 100.00 becomes 100, and 1E2 becomes 100. The numeric value is identical, but if you rely on the exact text of a number (for example a version string), store it as a JSON string instead.