JSON Minifier

Minify JSON online by removing indentation and unnecessary whitespace to produce compact, single-line JSON. Read more

Minify JSON online

JSON minification parses a JSON document and returns a compact representation without unnecessary spaces, indentation, or line breaks. The result is useful when reducing text size for transport, storage, fixtures, or a single-line configuration value.

Whitespace inside quoted strings is data and remains unchanged. Minification does not compress the transport itself, shorten property names, remove properties, or encrypt the result.

How to compact JSON

  1. Paste valid formatted or multi-line JSON into the input editor.
  2. Click Minify.
  3. Correct any syntax error reported by the parser.
  4. Copy the compact single-line output when parsing succeeds.

For example, an indented object containing "first name": "Ada Lovelace" loses whitespace around its structural punctuation, but the space inside both quoted strings remains part of the data.

Minification, formatting, and compression

Minified and formatted documents represent equivalent parsed JSON values even though their whitespace differs. RFC 8259 permits insignificant whitespace around JSON structural characters.

Minification typically saves more space on heavily indented input. HTTP gzip or Brotli compression can reduce transferred size further and is a separate operation. For source files that humans maintain, keeping a readable formatted version may be more practical than storing only the minified form.

JSON minifier FAQ

Does minifying JSON remove data?

It removes insignificant whitespace after parsing, not object properties or array items. Whitespace and escape sequences inside JSON strings remain meaningful.

Why does invalid input produce no minified result?

The tool parses the complete input before serializing it. Comments, trailing commas, invalid quoting, or mismatched brackets must be corrected first so the output is unambiguously valid JSON.

How do I make minified JSON readable again?

Paste it into the JSON Formatter and choose an indentation style. Use the JSON Validator when you only need a syntax check.

Input
Output
Settings