This site has been acquired by Toptal.com.
(Attention! API endpoint has changed)

HTML Minifier

Online HTML Minifier/Compressor. Free! Provides an API. Simple Quick and Fast.

Wget

# minifying some HTML to stdout (using '-')
wget --post-data='input=p { color : red; }' --output-document=- https://www.toptal.com/developers/html-minifier/raw

# minifying an HTML file (e.g. index.html -> html/index.html)
wget --post-data="input=`cat index.html`" --output-document=html/index.html https://www.toptal.com/developers/html-minifier/raw

Languages

Click on the language of your choice to see an example: