JSON Minifier – Compress JSON Online
Paste your JSON and instantly shrink it by stripping every space, tab, newline, and indentation that JSON parsers don't need. The output is a single-line compact string that's semantically identical to the original. Perfect for reducing API payload sizes, config files, and data transfers. Runs locally in your browser — nothing is uploaded.
Configure & input
Paste JSON and pick optionsCtrl + Enter (or Cmd + Enter) inside the input to minify instantly. String contents, escapes, and Unicode are always preserved exactly.
Minified output
Ready when you areYour minified JSON will appear here. Paste some JSON and click Minify JSON.
What does a JSON Minifier do?
A JSON minifier removes every byte of whitespace that JSON parsers don't need. That includes spaces between tokens, tabs, newlines, carriage returns, and indentation added by pretty-printers. The result is a compact single-line string that's semantically identical to the original — the same keys, the same values, the same arrays and objects, just without the cosmetic formatting.
Formatting only exists for humans. Parsers ignore whitespace between tokens entirely, so removing it has zero effect on how the JSON is interpreted. But it does reduce the size of the file, sometimes by 20–40% on pretty-printed JSON. That translates into faster API responses, smaller config files, and less bandwidth consumption overall.
This tool uses the browser's native JSON.parse and JSON.stringify functions to minify. That means it follows the RFC 8259 spec strictly — no surprises about escaping, Unicode, or number formats. And because everything runs locally in your browser, your JSON never leaves your device.
How to minify JSON online
- Paste your JSON into the input box. It can be pretty-printed, minified already, or a mix of both — the tool handles any valid JSON.
- Pick your options. Optionally sort keys A→Z for consistent output across tools, and choose whether to preserve non-ASCII characters as-is or escape them.
- Click Minify JSON. The tool parses, validates, and re-serialises your JSON without whitespace.
- Review the result. The output panel shows the minified JSON with syntax highlighting, along with byte-size stats and the percentage saved.
- Copy or download. Copy the minified JSON to your clipboard or download it as a
.jsonfile.
Why minify JSON?
Smaller payloads
Whitespace can make up 20–40% of a typical pretty-printed JSON document. Removing it shrinks files and speeds up API responses.
Lower bandwidth
Smaller files mean fewer bytes over the wire — critical for mobile apps, IoT devices, and high-traffic APIs.
Same semantics
JSON parsers ignore whitespace entirely. Minified JSON parses identically to the original — same keys, same values, same structure.
Unicode safe
Non-ASCII characters, escape sequences, and multi-byte symbols are handled correctly by the native parser.
Size comparison
See the exact byte size of the input and output side by side, along with the percentage reduction.
Works offline
Once the page loads, you can minify JSON without an internet connection. Bookmark it for offline work.
What gets removed during JSON minification?
| What | Before | After |
|---|---|---|
| Indentation | Leading spaces or tabs on each line | Removed |
| Newlines | Line breaks between tokens | Removed |
| Extra spaces | Space after :, before ,, between array items | Removed |
| Carriage returns | Windows-style \r\n line endings | Removed |
| Trailing whitespace | Spaces at line ends | Removed |
| String contents | Whitespace inside "..." | Preserved — never touched |
| Escape sequences | \n, \t, \", \\ | Preserved |
| Unicode characters | Emojis, accented letters, CJK | Preserved (optionally escaped) |
What is not changed: string values, numbers, booleans, null, escapes, and Unicode. The tool is conservative — it only removes whitespace that has no semantic meaning. There is no risk of corrupting your data, and the minified output parses to the exact same in-memory object as the original.
When to minify JSON (and when not to)
Good use cases for minification
- API responses: Every byte counts when you're serving thousands of requests per second.
- Config file distribution: Shipping JSON configs to clients — smaller is better.
- Large data exports: JSON dumps from databases or logs can be huge. Minify before archiving.
- Mobile and embedded: Constrained networks where every kilobyte matters.
- Cache-friendly URLs and localStorage: Compact JSON takes less storage space and travels faster.
When to keep JSON readable
- During development and debugging: Readable JSON is much easier to work with. Minify at build time, not while you're editing.
- Hand-edited config files: If humans edit it, indentation helps.
- Code reviews and version control diffs: Minified JSON produces meaningless diffs when a single character changes.
- Documentation and examples: Pretty-printed JSON is easier for readers to understand.
Best practice: keep your source JSON beautified, and produce a minified version as part of your build or deployment pipeline. That way you never lose the readable original.