Unformat.online

Minify JSON Online

Compress JSON by stripping all whitespace. Paste your formatted JSON and get the smallest valid output instantly — 100% client-side.

Rules:Smart QuotesConverts curly quotes (“” ‘’) to straight quotes. Always active.Non-Breaking SpacesReplaces non-breaking spaces (U+00A0) with regular spaces. Always active.Line EndingsNormalizes CRLF → LF and trims trailing whitespace per line. Always active.Removes invisible zero-width characters (U+200B, U+200C, U+200D) that silently break string comparisons.Strips the Byte Order Mark (U+FEFF) that causes “invalid character” errors in parsers and editors.Removes soft hyphens (U+00AD) from PDFs that show as garbled characters in code editors.Converts mixed tabs/spaces to a consistent indent width. Click to pick a size.Collapses all line breaks into one continuous paragraph. Great for reflowing PDF or email text.Control blank line density. Click to pick Keep 1 or Remove all.Text never leaves your browser
0 characters

What is JSON minification?

JSON minification removes all optional whitespace — spaces, tabs, and line breaks — from a JSON document. The result is functionally identical to the original: every parser produces the same data structure. The only difference is size and readability.

A prettified JSON object like:

{
  "user": {
    "id": 1,
    "name": "Alice"
  }
}

becomes:

{"user":{"id":1,"name":"Alice"}}

When to use minified JSON

Use minified JSON for production environments — API payloads, HTTP responses, CDN-served config files, and environment variable values. Every byte saved reduces transfer time and memory usage at scale.

Common use cases: embedding JSON in shell scripts or CI pipelines where newlines would break the command, storing JSON in databases or key-value stores with size limits, compressing request bodies before sending to external APIs.

Frequently Asked Questions

What does minifying JSON do?

It removes all whitespace outside of string values. The JSON is still valid and parses identically — it is just smaller. Typical compression is 30–60% depending on how deeply nested the original structure is.

Can I minify JSON that has errors?

Yes — the Auto-fix option (enabled by default) repairs common errors like single quotes, trailing commas, and unquoted keys before minifying. If your JSON has errors that cannot be auto-fixed, you will see an error message with the problematic location.

Is my JSON sent to a server?

No. All processing uses native browser JavaScript. Your data never leaves your device. Check the Network tab in DevTools to confirm — zero requests are made.