JSON Minifier
Paste JSON, strip the whitespace, and copy compact one-line output.
Output
minifiedFree JSON minifier
Minify JSON online in one paste
Use this JSON minifier to compress pretty-printed JSON into a single line before you embed it in a request, an environment variable, a test fixture, or a config value. Paste JSON on the left and copy minified JSON from the right. The input is validated first, so broken JSON returns an error instead of a half-minified result.
Minify JSON
Remove indentation, line breaks, and spaces between tokens to get the smallest valid JSON.
Validated first
The input is parsed as strict JSON before minifying, so mistakes are reported instead of copied.
Data stays the same
Only whitespace outside strings is removed. Keys, values, key order, and numbers are kept exactly.
JSON minify example
{
"id": 42,
"name": "Ada Lovelace",
"roles": ["admin", "editor"],
"active": true
}
{"id":42,"name":"Ada Lovelace","roles":["admin","editor"],"active":true}
When to minify JSON
Smaller request and response bodies
Whitespace in JSON is ignored by parsers, so removing it makes payloads smaller without changing their meaning. That matters for large API responses, mobile clients, and anything stored or sent many times.
JSON in env vars and one-line configs
Environment variables, CLI flags, HTTP headers, and some config formats expect a single line. Minify the JSON first so it fits without escaped newlines.
Compact test fixtures and logs
One-line JSON keeps fixtures, log lines, and database seed values short and easy to diff line by line.
Minify vs gzip
Servers usually gzip or brotli-compress JSON responses, which removes most of the size cost of whitespace on the wire. Minifying still helps for stored data, embedded strings, and places where compression is not applied.
More free online formatters
JSON Minifier FAQ
How do I minify JSON online?
Paste JSON into the input pane. FormatPaste validates it and shows the minified one-line JSON on the right, ready to copy or download.
Is this JSON minifier free?
Yes. The JSON minifier is free, with no sign-up and no limits beyond the 120,000 character paste size.
Does minifying change my JSON data?
No. Only whitespace between tokens is removed. Spaces inside string values, key order, and number formatting such as 1.0 or very large integers are kept exactly as pasted.
How much smaller does minified JSON get?
It depends on how the JSON was indented. Pretty-printed JSON with two-space indentation usually shrinks by 20 to 40 percent; deeply nested data shrinks more.
Why does the minifier show an error?
The input is parsed as strict JSON first. Trailing commas, single quotes, unquoted keys, and comments are not valid JSON, so fix those and the minifier will accept it.
How do I turn minified JSON back into readable JSON?
Paste it into the JSON Formatter. It pretty prints the same data with two-space, four-space, or tab indentation.