JSON Minifier: Minify JSON Online
Remove every unnecessary space and line break from your JSON in one click. The output is the same data in the smallest valid form, produced in your browser.
How to minify JSON
- Paste your JSON into the editor.
- Click Minify or press Ctrl+Shift+M.
- Copy the result, or open Export and choose JSON (minified) to download
data.min.json.
Invalid JSON cannot be minified, so fix any error shown in the status bar first. The JSON validator explains common errors.
What minifying changes
Minifying removes whitespace outside of strings: indentation, line breaks, and spaces after colons and commas. Keys, values, and their order are untouched, and whitespace inside strings is preserved, so the data is identical. To make it readable again, click Format.
Example
This formatted JSON:
{
"id": 7,
"tags": ["a", "b"],
"active": true
}
becomes this minified JSON:
{"id":7,"tags":["a","b"],"active":true}
Same data, 14 characters shorter here. The saving grows with nesting depth and indent size.
When to minify JSON
- API responses and request bodies, to send fewer bytes.
- JSON embedded in HTML, environment variables, or command-line arguments, where line breaks are awkward.
- Values stored in a database column, cache, or
localStorage.
The saving depends on how much whitespace the original had. Deeply indented JSON shrinks more than JSON that was already compact. Minifying is different from compression: servers usually also apply gzip or Brotli, and the two work together.
Related tools
Need the opposite? JSON Prettier pretty prints with 2 spaces, 4 spaces, or tabs. You can also export to CSV or YAML, or compare two documents.
More JSON tools
- Format JSON: formatter, validator, tree viewer and diff.
- JSON Prettier: pretty print JSON and repair invalid JSON.
- JSON Validator: check JSON syntax and find errors.
- JSON Diff: compare two JSON documents.
- JSON to CSV: convert JSON to CSV (and CSV back to JSON).
- JSON to YAML: convert JSON to YAML.
- JWT Decoder: decode and inspect JSON Web Tokens.
- Common JSON Errors: causes and fixes for invalid JSON.
Frequently asked questions
How do I minify JSON?
Paste it into the editor and click Minify, or press Ctrl+Shift+M.
Does minifying change my data?
No. Only whitespace outside strings is removed. Keys, values, and order stay the same.
How do I undo minification?
Click Format to re-indent the JSON, or use Undo.
Is minified JSON the same as compressed JSON?
No. Minifying removes whitespace. Compression such as gzip is applied separately by the server and can be combined with it.
Is my data uploaded?
No. Minification runs entirely in your browser.