Quantify the saving from minifying and compressing JSON.
Minification removes whitespace for roughly a fifth saving, but gzip does far more because JSON repeats key names constantly. With compression enabled, minification adds only a marginal further gain. Enabling compression on the server is a one-line change that saves far more than minifying, which is why it should always come first.
JSON Minification Savings
Minified = pretty × (1 − whitespace share); gzipped = minified × (1 − gzip saving)
Minified = pretty × (1 − whitespace share); gzipped = minified × (1 − gzip saving) Minification removes whitespace for roughly a fifth saving, but gzip does far more because JSON repeats key names constantly. With compression enabled, minification adds only a marginal further gain.
Enabling compression on the server is a one-line change that saves far more than minifying, which is why it should always come first.
This calculator takes 4 inputs: Pretty printed size, Share that is whitespace and indentation, Additional saving from gzip, Monthly requests. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.