HTML Minifiers Benchmarks

May 7, 2026 ยท View on GitHub

Updated: 2026-05-07

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.com637.4%11.3%34.1%10.8%8.6%11.3%
en.wikipedia.org2254.5%7.4%7.3%6.1%6.0%6.3%
developer.mozilla.org11538.8%42.7%50.8%41.0%41.0%41.5%
leanpub.com3681.2%10.6%8.3%6.7%1.8%7.0%
html.spec.whatwg.org149-3.9%0.7%-2.6%0.3%0.2%1.5%
stackoverflow.blog1343.9%7.6%7.2%4.4%4.7%5.3%
edri.org847.4%13.4%32.3%12.1%7.8%12.5%
mastodon.social343.0%14.9%14.7%5.8%5.2%7.2%
home.cern284N/A12.7%25.6%8.1%4.6%10.0%
css-tricks.com1658.5%16.6%29.6%14.6%8.6%15.4%
github.com5553.0%17.4%16.5%7.3%5.8%6.4%
tc39.es72325.7%8.2%6.6%6.7%6.2%8.0%
eff.org538.9%15.8%11.1%13.5%11.4%13.4%
un.org15214.2%22.6%41.3%20.0%15.2%17.4%
bbc.co.uk6670.8%7.5%5.9%4.6%1.2%6.6%
faz.net13873.3%6.7%11.9%4.4%3.6%4.5%
apple.com2846.4%9.6%8.7%7.7%6.9%7.3%
weather.com22840.1%9.3%9.1%9.2%0.2%9.3%
w3.org5118.8%24.3%23.2%24.2%20.2%23.9%
lafrenchtech.gouv.fr15713.1%17.6%62.5%16.8%13.8%17.3%
sitepoint.com2340.7%10.1%9.6%6.1%1.0%5.6%
Avg. minify rate7.3%13.7%19.4%11.1%8.5%11.4%

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