JSON Minifier strips every unnecessary space, tab and line break from JSON and puts it on a single line, ready for an API request, a config value or an HTML attribute. It checks the JSON as it goes, so you never ship a broken file, and it tells you how many characters you saved. Your data stays in your browser.
How to minify JSON
- Paste your JSON, or click Open file to load a .json file. A file is minified as soon as it opens.
- Click Minify.
- Check the status line, for example “Minified: 4,812 → 3,105 characters”.
- Click Copy result or Download .json.
Tick Sort keys A–Z before minifying to get the same output every time for the same data, which helps with caching and comparing.
Formatted versus minified
| Formatted | Minified | |
|---|---|---|
| Readable by people | Yes | Hard |
| Same data | Yes | Yes |
| Size | Larger | Smallest |
| Good for | Code review, docs, editing | APIs, storage, embedding |
Example, formatted:
{
"name": "Ann",
"tags": ["admin", "editor"]
}
The same JSON minified:
{"name":"Ann","tags":["admin","editor"]}
When to minify
- API payloads and responses, where every byte is sent on every request.
- Values in environment variables or a single-line config field.
- JSON embedded in HTML, in a
data-attribute or a script tag. - Storing JSON in a database column, local storage or a cache key.
- Test fixtures where you want one record per line.
Servers usually also compress responses, so the saving on the wire is smaller than the character count suggests. Minifying still helps where no compression is applied, such as storage and environment variables.
Errors
If the JSON is not valid, the minifier shows the line and column of the first error instead of a result. Click Repair to fix trailing commas, comments or single quotes, or see the JSON Validator for the common errors and fixes. To make JSON readable again, use the JSON Formatter.