JSON Minifier is a free tool that removes every unnecessary space, tab and line break from JSON, producing the smallest valid version on a single line. It runs in your browser, so your data is never uploaded, and it shows how many bytes you saved.
How to minify JSON
- Paste your JSON into the left box, or open a
.jsonfile. - The minified result appears on the right, with the size before and after underneath.
- Copy it, or download it as
data.min.json.
To go the other way and make minified JSON readable again, choose an indentation option above the result, or use the JSON Formatter.
Example
{
"name": "Ana García",
"roles": ["admin", "editor"],
"active": true
}becomes the equivalent one-line JSON:
{"name":"Ana García","roles":["admin","editor"],"active":true}Notice that the space inside "Ana García" is kept: only whitespace between values is removed.
When minifying JSON helps
- Storing JSON in an environment variable, a database column or a single line of a CSV file.
- Embedding JSON in HTML, a URL or a command-line argument.
- Reducing the size of static JSON files served without compression.
- Making log lines one-JSON-object-per-line (the "JSON Lines" format).
What it won’t do
Minifying only removes whitespace; it doesn’t shorten property names or remove data. If your JSON is invalid, the minifier shows the error and its position instead of producing output, because guessing how to fix broken JSON could change its meaning.
Frequently asked questions
Does minifying change the data?
No. Only whitespace between values is removed. Spaces inside text values are kept, and numbers are copied exactly, so the minified JSON means exactly the same thing.
How much smaller will my JSON get?
It depends on how it was indented. Pretty-printed JSON typically shrinks by 10–30%. The size before and after is shown under the result.
Should I minify JSON before sending it from an API?
Usually your server’s gzip or Brotli compression already removes most of the benefit. Minifying helps most for JSON embedded in files, URLs, environment variables or databases.
Last updated