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 options
Tip: Press Ctrl + Enter (or Cmd + Enter) inside the input to minify instantly. String contents, escapes, and Unicode are always preserved exactly.

Minified output

Ready when you are
Ready — paste JSON and click Minify.

Your 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

  1. 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.
  2. 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.
  3. Click Minify JSON. The tool parses, validates, and re-serialises your JSON without whitespace.
  4. Review the result. The output panel shows the minified JSON with syntax highlighting, along with byte-size stats and the percentage saved.
  5. Copy or download. Copy the minified JSON to your clipboard or download it as a .json file.

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?

WhatBeforeAfter
IndentationLeading spaces or tabs on each lineRemoved
NewlinesLine breaks between tokensRemoved
Extra spacesSpace after :, before ,, between array itemsRemoved
Carriage returnsWindows-style \r\n line endingsRemoved
Trailing whitespaceSpaces at line endsRemoved
String contentsWhitespace inside "..."Preserved — never touched
Escape sequences\n, \t, \", \\Preserved
Unicode charactersEmojis, accented letters, CJKPreserved (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.

Frequently asked questions

A JSON minifier removes all unnecessary whitespace — spaces, tabs, newlines, and indentation — from a JSON document. The result is a compact single-line string that is semantically identical to the original. Parsers treat minified and formatted JSON exactly the same way.
Yes, completely free. No signup, no watermark, no hidden charges. Minify as much JSON as you want, as many times as you want.
No. Minification only removes whitespace between tokens. Keys, values, arrays, and objects are preserved exactly. The JSON parses to the same in-memory object either way.
It depends on how much whitespace was in the original. Pretty-printed JSON typically shrinks by 20–40%. On deeply nested objects the reduction can be even larger. This tool shows the exact bytes saved and the percentage reduction.
Yes. The tool handles JSON up to several megabytes easily. Very large files (over 10 MB) may take a moment to process depending on your device, but there's no hard limit.
Non-ASCII characters are handled correctly. The tool uses JavaScript's native JSON.stringify and JSON.parse functions, which support all valid JSON escapes and Unicode sequences.
Yes. Once the page loads, the JSON minifier works without an internet connection. All processing happens locally in your browser using JavaScript.
Absolutely. Everything runs in your browser. The JSON you paste never leaves your device — no server processing, no logging, no data storage. Close the tab and it's gone.
Yes. Use the Download .json button to save the minified JSON as a file. The file is created entirely in your browser using a Blob URL — no server round-trip.
Minify compresses JSON by removing whitespace to make the file as small as possible. Beautify (format) does the opposite — it adds indentation and line breaks to make JSON readable. Use minify for production, beautify for editing.