JSON minifier
This JSON minifier strips the spaces, tabs and line breaks that make JSON readable but add bytes. Developers use it to shrink payloads, config values and test fixtures and to see how much space formatting costs.
- Runs in your browser
- Free, no account needed
- Copy or download the result
Result
Example
{
"name": "Ada Lovelace",
"languages": [ "en", "fr" ],
"active": true,
"score": 98.5
}{"name":"Ada Lovelace","languages":["en","fr"],"active":true,"score":98.5} Original size: 94 bytes Minified size: 74 bytes Saved: 20 bytes (21.3%)
How to use the json minifier
- Paste your JSON into the JSON box.
- Choose the Size report: Show size report below, or Minified JSON only.
- Press Run.
- Use Copy result or Download to save the minified JSON.
How it works
The JSON is fully validated first, and any error gives the line and column.
Only whitespace outside strings is removed. Text inside strings, the spelling of numbers and the order of keys stay exactly as written, so large numbers are not rounded.
Sizes are counted in UTF-8 bytes, the way files and HTTP bodies are measured, and the percent saved is rounded to one decimal place.
Minifying is not compression like gzip. Web servers usually apply gzip or Brotli on top of it.
Everything runs in your browser. Your input is not uploaded or stored.
Questions and answers
Does minifying JSON change the data?
No. Only spaces, tabs and line breaks between values are removed, so any JSON parser reads the same data.
How is the saving calculated?
It is the original size minus the minified size, both in UTF-8 bytes, divided by the original size.
How do I make minified JSON readable again?
Paste it into the JSON formatter, which adds the indentation back.
Can it minify JSON with comments?
No. Comments are not part of JSON, so they are reported as an error. Remove them first.