JSON Minifier

Paste formatted JSON and get a single compact line, plus the size saved.

Runs in your browser — nothing you enter is uploaded

JSON Minifier

Press Ctrl+Enter (or Cmd+Enter) to minify

Tip: press Ctrl+Enter (Cmd+Enter on Mac) inside a text box to run.

Your result will appear hereFill in the fields and press “Minify JSON”.

Formula

  • minified = JSON with every space, tab and line break outside strings removed
  • Strings, numbers and key order are unchanged.

Same data, fewer characters.

Worked example

Pretty-printed object

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

Bytes saved

11 bytes

Before: 30 bytes

After: 19 bytes

Reduction: 36.7%

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

How it works

Minifying removes the indentation and line breaks that make JSON readable but add weight. The tool parses first, so invalid JSON is reported instead of being silently mangled, then writes the same values back with no extra whitespace.

Whitespace inside strings is data and is preserved. The saving is usually 10–40% for pretty-printed files, though gzip compression on the network already removes much of the same redundancy. To reverse it use the JSON Formatter, and to check validity alone use the JSON Validator.

Assumptions and limits

  • Output is a single line.