Minify JSON

Strip every space and line break from JSON for API calls, environment variables and smaller files — and check it is valid at the same time.

How to minify JSON

  1. Paste or drop your JSON. Minify is already selected.
  2. The one-line version appears on the right, with its size in bytes.
  3. Copy it, or Download a .min.json file.

When to minify

Back to readable

Switch Indent to 2 or 4 spaces to turn minified JSON back into a readable version — or open the JSON Formatter. Comments in config files? Tick Allow comments and trailing commas and they are removed while minifying.

Private by design

The JSON never leaves your browser. Paste API responses with tokens or customer data without sending them to a server.

Troubleshooting

Minify vs compress

Minifying removes whitespace, typically 20–40% of a formatted file. Web servers usually gzip or Brotli-compress JSON on top of that, which shrinks it much further — so for API responses minifying matters most for single-line needs, like environment variables, and for storage. Need to read it again later? Format it back in one click.

Frequently asked questions

Does minifying change my data?

No. Only spaces and line breaks between values are removed; text inside strings is untouched.

How much smaller does it get?

Typically 20–40% for formatted JSON; the status line shows the exact size.

Can I un-minify JSON?

Yes. Choose 2 or 4 spaces under Indent.

Is my JSON uploaded?

No.

Can I minify JSON with comments?

Yes. Tick Allow comments and trailing commas; comments are dropped.

Does minifying sort the keys?

No, the order stays the same unless you tick Sort keys.

Runs entirely in your browser, powered by a JSON parser built for this site that keeps numbers exact. Built and tested by Diego Callegari · how we test · updated 26 October 2026.