Formatter Validator Minifier JSON ↔ YAML JSON → CSV JSON ↔ XML JSON Diff Schema Validator JSONPath Tester JWT Decoder More Tools Blog FAQ
Compact JSON · Reduce payload size · Save bandwidth

JSON Minifier Online

Compress JSON to a single line by removing all unnecessary whitespace. Typically reduces size by 30-60% while preserving exact data. Perfect for API responses, database storage, and embedding JSON in URLs.

Input JSON 0 bytes
1
Minified output
Minified JSON will appear here
What is JSON minification?

What is JSON minification?

JSON minification is the process of removing all unnecessary whitespace from a JSON document to produce the smallest valid representation of the same data. Where pretty-printed JSON uses indentation, line breaks, and spaces for readability, minified JSON squeezes everything onto a single line with no whitespace at all.

The data itself is unchanged — every key, value, type, and structural element is preserved exactly. Minification is purely cosmetic: it strips characters that don't affect parsing. A JSON parser produces the same in-memory result whether it reads minified or pretty-printed input.

So why bother? Because whitespace adds up. A typical pretty-printed JSON with 2-space indentation is 40-60% larger than its minified equivalent. With 4-space or tab indentation, the difference is even bigger. For API responses sent thousands or millions of times per day, that translates to real bandwidth, real latency, and real money.

How to minify JSON online

How to minify JSON online

Three steps:

  1. Paste your JSON into the input panel — formatted or already minified, either works. You can also upload a .json file or drag and drop one.
  2. Click Minify. The output appears immediately in the right panel as a single compact line.
  3. Copy or download the minified result. The status message shows exactly how many bytes you saved.

The tool also works in reverse — click Expand to convert minified JSON back to pretty-printed form. Use this when you receive a minified API response and want to read it.

When should you minify JSON?

When should you minify JSON?

Minification helps in any context where JSON is transmitted, stored, or transferred in volume:

API API responses

Production APIs almost always return minified JSON. With responses going out thousands of times per second, removing 50% of the bytes meaningfully reduces server bandwidth costs and improves response time.

DB Database storage

If you store JSON in a database column (PostgreSQL jsonb, MySQL JSON, MongoDB), minification reduces storage size, speeds up reads, and reduces network transfer between database and application.

URL Query parameters

JSON embedded in URLs needs to fit in the URL length limit (typically 2048 chars). Minify first, then URL-encode, to stay under the limit and keep URLs reasonably short.

MQ Message queues

Kafka, RabbitMQ, AWS SQS, and similar systems often charge by message size. Minified JSON reduces per-message cost and lets you fit more data inside fixed message limits.

JS Frontend bundles

JSON configs embedded in webpack/Vite bundles add directly to your JS bundle size, which slows page load. Minified configs shrink the bundle.

Webhook payloads

Stripe, GitHub, Slack, and other webhook providers often have payload size limits (256 KB typical). Minification fits more data into a single hook.

How much does minification actually save?

How much does minification actually save?

The savings depend on your indentation style and how deeply nested your data is:

When NOT to minify JSON

When NOT to minify JSON

Some scenarios where pretty-printed JSON is the better choice:

The rule of thumb: minify for production transmission and storage; keep it pretty for development, source control, and documentation.

Common questions

FAQ — Json Minifier

What does it mean to minify JSON?
Minifying JSON means removing all unnecessary whitespace — spaces, tabs, newlines — to produce the smallest valid representation of the same data. The data itself doesn't change; only the formatting does. A minified JSON file parses to exactly the same in-memory object as its pretty-printed equivalent.
How much smaller will my JSON be after minification?
Typically 30-60% smaller. The exact amount depends on indentation style (4-space indent saves more than 2-space) and nesting depth (deeper nesting saves more). Run your file through the tool to see the precise saving for your specific data.
Will minification break my JSON?
Only if your JSON was invalid to begin with. The minifier first parses the JSON (which rejects invalid input) and then re-serializes it without whitespace. If your original is valid, the minified version is guaranteed to be valid too — and to parse to identical data.
Is minified JSON valid JSON?
Yes. The JSON specification doesn't require whitespace anywhere — it's purely optional, added for human readability. Every JSON parser handles minified JSON identically to formatted JSON.
Can I un-minify (expand) minified JSON?
Yes — this tool's Expand button does exactly that. It re-formats minified JSON with proper indentation. Since the data is identical, expanding is just the reverse operation.
Should I always minify production JSON?
Generally yes for API responses, storage in databases, and over-the-wire transmission. But not for files checked into source control (configs, schemas, fixtures) — those should stay pretty-printed for diff readability.
Does gzip make minification unnecessary?
Mostly, but not entirely. Gzip/brotli compress both pretty and minified JSON to similar final sizes — repeated key strings dominate the compressed size. But minified JSON has these advantages: (1) less memory used on the server before compression; (2) clients without compression support get the smaller payload directly; (3) JSON stored in databases is rarely compressed, so storage savings are real.
Does minification affect numeric precision or Unicode?
No. Strings are preserved byte-for-byte — including Unicode escapes, control characters, and any special encoding. Numbers are re-serialized in their canonical form, but the precision is the same as parsing them produced. The only thing that changes is whitespace between tokens.
Can I minify huge JSON files?
The browser handles documents up to about 50 MB comfortably. For larger files, use a streaming command-line tool like jq -c . file.json > file.min.json — that's the canonical way to minify large JSON outside a browser.
How does this compare to other JSON minifiers?
Functionally identical to most online minifiers — JSON minification is a well-defined operation with no creativity involved. The differentiators here are (1) browser-side processing (your JSON never touches a server), (2) bidirectional (minify and expand in the same tool), (3) instant feedback showing exact bytes saved.
Why is my minified JSON still big?
If your JSON is large after minification, the data itself is large — there's no further size reduction available through formatting. Consider: (1) is there data you don't actually need? (2) are key names unnecessarily verbose (could you shorten customer_billing_address_line_1 to addr1)? (3) should you compress with gzip/brotli on top?
Our Network