JSON is the everyday language of web APIs and configuration files. Readable JSON has indentation and line breaks, but computers don't need them. Minifying JSON removes that formatting to make the data smaller.

What minification does
Compare the two versions of the same data.
Formatted:
{
"name": "Ada",
"roles": [
"admin",
"editor"
]
}
Minified:
{"name":"Ada","roles":["admin","editor"]}
Both mean exactly the same thing. Minification removes spaces, tabs and line breaks that exist only for human readers — but never touches spaces inside string values.
Why minify JSON?
- Smaller payloads. Less data to send over a network means faster responses, especially on slow mobile connections.
- Lower bandwidth and storage costs when you're serving or storing a lot of JSON.
- Compact embedding in URLs, environment variables, logs or HTML attributes.
How much you save depends on how heavily formatted the original is: deeply indented JSON shrinks far more than JSON that was already compact.
Minification vs compression
Web servers usually compress responses with gzip or Brotli. Compression handles repeated whitespace well, so it captures much of the same saving — which means minifying matters less than people expect for API responses. It still helps a little, and it helps a lot where compression isn't used, such as JSON pasted into a config field.
When not to minify
- Files people edit by hand, like configuration checked into version control. Readable formatting makes changes easy to review.
- During debugging, when you need to read the data.
- Where diffs matter. A minified file is one long line, so every change looks like a whole-file rewrite.
A common approach is to keep the readable version in your repository and minify at build or send time.
How to minify JSON
- Paste your JSON into the JSON Minifier.
- The compact version appears instantly, with the size before and after.
- Copy it or download it as a
.jsonfile.
If the JSON is invalid, you'll see the parser's message with the line and column of the problem instead. Everything runs in your browser, so private data is never uploaded.

Going the other way
To make minified JSON readable again, use the JSON Formatter, or explore it as an interactive tree in the JSON Viewer.
Common problems
- Trailing commas, single quotes and comments aren't valid JSON, and will produce an error.
- Very large numbers may lose precision in some programming languages, regardless of formatting.
FAQ
Does minifying change my data? No. Keys, values and structure stay identical — only formatting whitespace is removed.
Is minified JSON still valid? Yes. It's exactly as valid as the original.
Can I minify JSON with comments? Standard JSON doesn't allow comments. Remove them first.
Try it now
Use the free JSON Minifier.
Related reading
Read What Is JSON and How to Format It and How to Validate JSON and Fix Errors. Browse the full blog for more guides.
