HTML Minifiers Benchmarks

August 17, 2026 ยท View on GitHub

Updated: 2026-08-17

This benchmark measures how well different tools minify real-world HTML pages. For every URL, the page is fetched and the same source HTML is passed to each minifier. Each minifier is run with aggressive settings, including CSS/JS/SVG optimization when supported. Results are reported as minification rate (percentage size reduction vs the original HTML). Higher is better.

WebsiteSource (KB)html-minifier-terserhtml-minifier-nexthtmlnanominifyminify-htmlswc-html
alistapart.com636.9%11.1%34.4%10.3%8.1%11.0%
developer.mozilla.org11939.1%42.8%52.8%41.2%41.1%41.6%
css-tricks.com127.9%40.5%36.8%18.5%8.1%24.8%
en.wikipedia.org2524.6%7.6%7.1%5.9%6.0%6.3%
github.com5611.4%15.5%14.8%5.2%4.0%4.5%
lafrenchtech.gouv.fr14.9%5.7%5.1%7.9%7.5%7.5%
edri.org847.4%12.9%32.3%12.2%7.9%12.6%
html.spec.whatwg.org151-3.9%0.6%-2.6%0.3%0.2%1.5%
leanpub.com3341.2%8.7%6.9%4.9%1.9%5.4%
stackoverflow.blog1344.1%6.9%6.6%4.5%4.9%5.5%
apple.com2486.0%9.6%8.7%7.6%6.7%6.9%
eff.org538.8%15.4%10.9%13.3%11.3%13.3%
home.cern290N/A12.9%23.2%8.1%4.7%10.2%
mastodon.social543.9%13.5%13.4%5.8%7.2%8.6%
w3.org5019.0%24.5%23.4%24.4%20.4%24.1%
weather.com3400.5%8.4%6.5%6.5%0.6%6.8%
bbc.co.uk7040.8%7.1%5.9%4.7%1.2%6.3%
un.org15414.1%22.1%41.0%19.8%15.1%17.3%
faz.net15853.4%10.7%15.5%4.6%3.7%8.6%
tc39.es74105.7%8.2%6.6%6.7%6.2%8.0%
Avg. minify rate7.1%14.3%17.2%10.8%8.5%11.6%

New HTML minifiers are welcome! Please submit a PR to add a new minifier to the benchmark, or open an issue to request it.

Benchmark

Run the benchmark locally:

npm install --omit=dev
npm start

After that README.md will be updated with the new benchmark data.

README.md is generated dynamically from README.template.md. So don't alter it.

Other benchmarks