Free · runs in your browser
JSON Minifier
Strip the whitespace from JSON to make it smaller. Paste, press Minify, and compare the sizes. It runs in your browser.
Paste JSON above, or load the sample.
How to minify JSON
- Paste your JSON into the Input box.
- Press Minify. If the JSON is invalid you will see the error instead, because only valid JSON can be minified.
- Compare the input and output sizes shown above each box, then press Copy.
Example
{
"id": 7,
"tags": [ "a", "b" ],
"ok": true
}minifies to
{"id":7,"tags":["a","b"],"ok":true}When minifying is worth it
- JSON stored in a database column, a cache key or
localStorage, where every byte is kept. - Payloads in a URL, a cookie or a QR code, where length is limited.
- Config files bundled into an app that are never edited by hand.
When to leave it readable
Keep formatted JSON in files people edit and review in version control. A minified file is one long line, so every change shows up as a whole-file diff. Minify at build time, not in the source.
Frequently asked questions
What does minifying JSON do?
It removes every space, tab and line break that is not inside a string, so the same data takes fewer bytes. The data itself does not change.
Does minifying change my data?
No values change. Key order is kept, unless you tick Sort keys. Numbers are re-serialised, so 1.0 becomes 1 and 1e2 becomes 100, which is the same number.
How much smaller will it get?
It depends on how much indentation the original had. Pretty-printed JSON with deep nesting often shrinks by a fifth or more; already compact JSON barely changes. The tool shows both sizes so you can see your own number.
Should I minify JSON I send over HTTP?
Compressing the response with gzip or Brotli removes much of the same redundancy, so the saving from minifying on top of compression is smaller. Minifying still helps for JSON stored in databases, localStorage, URLs and config.