Free Online JSON Minifier

Paste JSON below and click the Minify button in the toolbar to strip all whitespace and produce the smallest valid representation.

Input Ready

Input statistics are available via the Stats button above this field.

Output

Output statistics are available via the Stats button above this field.

Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.

What the JSON Minifier does

The JSON Minifier removes every space, tab and line break that sits outside string values, producing the smallest valid version of your JSON. The data itself does not change: keys, values and order stay exactly as they were.

Minifying works on the text, not on a re-parsed copy, so very large integers such as 12345678901234567890 and decimals like 1.10 are kept digit for digit instead of being rounded by JavaScript. The JSON is still validated first, so invalid input is reported instead of being squashed.

When to use it

  • Shrinking an API payload, config value or fixture before sending it, storing it in a database field or embedding it in a script.
  • Fitting JSON onto one line for an environment variable, a curl command or a log entry.
  • Turning formatted JSON back into compact form after reading it with the JSON Formatter & Beautifier.
  • Comparing the size of a payload before and after removing whitespace, to see how much bandwidth formatting costs.

Worked example

Input

{
  "id": 42,
  "name": "Ana",
  "tags": ["admin", "editor"],
  "active": true
}

Output

{"id":42,"name":"Ana","tags":["admin","editor"],"active":true}

Common questions about the JSON Minifier

How much smaller does the JSON get?

It depends on the indentation. Pretty-printed JSON with two-space indentation usually shrinks by 15 to 30 percent; deeply nested files shrink more. HTTP compression such as gzip saves additional space on top of that.

Will spaces inside strings be removed?

No. Only whitespace between tokens is removed. Text inside quotes, including spaces and escaped characters, stays exactly as written.

Is minified JSON still valid?

Yes. Minified JSON is equivalent to the original, and every JSON parser reads it the same way. Use the JSON Validator if you want to double-check.

Is this tool free?

Yes, it's free to use. No signup, no email required. Get results on this page.

How do I get my result?

Use the tool on this page. Your result appears here; no email delivery is required.