{ } JSON Workbench0 network requests. Check DevTools

"JSON Minifier":{ }

Paste JSON and get a compact, single-line version with all insignificant whitespace removed: the smallest text that still parses identically. Non-standard input is auto-repaired first. Runs 100% in your browser: zero network requests, so your data never leaves the page.

What is a JSON minifier?

A JSON minifier compacts JSON to a single line by stripping every space, tab, and newline that a parser ignores. The result is the smallest text that parses to exactly the same value. It is the inverse of a beautifier: minify for transport and storage, beautify for reading. This tool minifies in your browser with zero uploads, and auto-repairs messy input so even hand-edited or LLM-generated JSON compacts cleanly.

Minify vs. gzip

Minifying and gzip are complementary. Minifying removes whitespace at the JSON level; gzip then compresses the remaining bytes at the transport level. Servers usually gzip responses automatically, but minifying first still helps: it shrinks what gets stored, embedded, or logged, and reduces the input gzip has to work on. For the absolute smallest wire size, minify and enable gzip/brotli.

How to use

  1. Paste JSON into the Input pane.
  2. The minified, single-line output appears instantly in the Output pane.
  3. Non-standard input (single quotes, trailing commas, comments) is auto-repaired first, so messy JSON minifies too.
  4. Copy or download the result. Your input is never modified.
  5. Everything runs in your browser; check DevTools → Network for zero requests.

Examples

Pretty JSON → minified

Input
{
  "id": 42,
  "name": "workbench",
  "tags": ["json", "diff"]
}
Output
{"id":42,"name":"workbench","tags":["json","diff"]}

Whitespace and newlines removed

Input
{
  "a": 1,

  "b": [ 1, 2, 3 ]
}
Output
{"a":1,"b":[1,2,3]}

Messy input is repaired, then minified

Input
{ 'a': 1, 'b': 2, }
Output
{"a":1,"b":2}

FAQ

What does minifying JSON do?

It removes all insignificant whitespace (spaces, tabs, and newlines between tokens), producing the smallest valid JSON that still parses identically. Keys, values, and order are unchanged.

Why minify JSON?

Smaller payloads transfer faster and cost less bandwidth. Minified JSON is ideal for API responses, config embedded in HTML/JS, message queues, and anywhere size matters. Gzip shrinks it further.

Does minifying change my data?

No. Only formatting whitespace is removed. The parsed value is byte-for-byte equivalent; JSON.parse of the minified output equals the original.

Is my JSON uploaded?

No. Minification runs 100% in your browser. Open DevTools → Network and confirm zero requests after the page loads.

Can it minify invalid JSON?

Common non-standard input (single quotes, trailing commas, comments, Python-style True/False/None) is auto-repaired first. Genuinely broken JSON shows the exact line and column of the error instead.

Related tools