JSON Minifier

Strip whitespace and shrink JSON to a single line.

Your data is processed entirely in your browser and is never uploaded.

Tool workspace

INPUT JSON

Drag & drop file here or browse

Status: Empty0 chars

Options

Deterministic output for diffing. Values are never changed.

Ready, paste to start
MINIFIED OUTPUT
Output: Empty0 chars
HOW IT WORKS

Minify JSON in three steps

Paste or upload

Drop in formatted or pretty-printed JSON. Validity is checked as you type.

Minify

Whitespace is stripped to a single line. Optionally sort keys for a deterministic result.

Copy & ship

Grab the smaller payload. Copy to clipboard or download, and watch the saved-bytes readout.

Docs · Format

Minifying is formatting run in the opposite direction

Minifying is the same operation as formatting, done in reverse: the engine parses your JSON into memory and writes it back out with every bit of whitespace removed, so a pretty-printed document collapses to a single dense line. Because it parses first, it *cannot* repair broken JSON. Invalid input reports the exact line and column instead of a guess. Your data is never altered: only whitespace disappears, and the optional sort-keys reorders object properties alphabetically without touching a value. The readout shows the before/after byte counts and the percentage you saved, and large files run in a background worker so the editor never locks up.

Things to know

Smaller is the point, not readable

Minified JSON is deliberately hard for a human to scan. Use it when size and transfer cost matter more than readability: an API body, a URL, a bundle, storage. For reading or editing, reach for the Formatter instead.

Invalid input won't minify

Minification parses first, so the same trailing-comma mistake that breaks validation breaks minifying too. Load this and you'll get the exact error, not a compact result.

{
  "name": "Ada",
  "role": "engineer",
}
Sort keys never rewrites values

Enabling sort-keys reorders each object's properties alphabetically for stable, diff-friendly output. Values are untouched and array order is always preserved.

Whitespace inside strings is sacred

Spaces inside a quoted string are data, not padding; they are preserved exactly. The minifier only strips the whitespace that sits between tokens.

{
  "phrase": "hello   world"
}

Try these

Cramped one-liner
{"name":"Ada","role":"engineer","tags":["pioneer","writer"],"active":true}

It's already small, so minifying keeps it exact and reports the tiny saving.

Pretty-printed source
{
  "user": { "id": 1, "name": "Ada" },
  "active": true,
  "score": null
}

Watch a readable document collapse to a single dense line.

pair this withPretty-print it → JSON Formatter·Validate first → JSON Validator

FAQ

Frequently asked questions

Is my JSON uploaded anywhere?

No. Minification runs entirely in your browser, in a background worker for large files. Your data never leaves your machine.

Does minifying change my data?

Only the whitespace. Every key, value, number, and array order is preserved exactly. The optional "sort keys" reorders object properties alphabetically but never alters values.

When should I minify?

When size matters more than readability: embedding JSON in a bundle, sending it over a slow link, or storing many records. For editing or debugging, the Formatter (beautifier) is the better tool; minified JSON is intentionally hard for humans to read.