Skip to main content

JSON Minifier

Parse JSON and emit a compact single-line document. Invalid JSON is rejected unless repair is on.

Rated 4.7 out of 5 based on 512 reviews

Input
Output

How to minify JSON

  1. Paste JSON.
  2. Turn on Repair if the paste is almost JSON but not strict.
  3. Copy the compact output if parsing succeeds.

JSON minification

Whitespace removal after a successful parse

OutputJSON.stringify with no indent
RepairOptional: comments, trailing commas, single quotes, unquoted keys
StringsString values stay the same. Only whitespace outside strings is removed

Minify versus format

Minify shrinks transfer size. Format makes JSON readable. Both need a successful parse first. See the JSON formatter.

What minify does not change

Minify does not shorten string values, rename keys, or drop fields. It only removes whitespace outside strings after a successful parse. Turn on Repair if the paste includes trailing commas or comments.

Minifier questions

Does minify shorten string values?
No. Only whitespace outside strings is removed.
Is my JSON uploaded?
No. Parsing happens in the page you opened.
What if parsing fails?
The output clears and the status shows the parser message. Turn on Repair for trailing commas, comments, single quotes, and unquoted keys.