Minify your HTML

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

Digital Ocean

We recommend Digital Ocean for hosting your sites. Free $10 credit when you sign up.

Wget

# minifying some HTML to stdout (using '-')
wget --post-data='input=p { color : red; }' --output-document=- https://html-minifier.com/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://html-minifier.com/raw

Language Examples

Click on the language of your choice:

wget Curl Node.js Python Ruby Perl PHP C#

More Languages

I'd love to add more examples in your favourite programming language, so feel free to send them my way. Email andychilton at that gmail place in the sky or tweet to me @andychilton.