HTML Minifier

Shrink your HTML by removing comments and the whitespace browsers ignore between tags.

HTML Minifier

🔒 Nothing you enter is sent anywhere or stored. All processing happens in your browser.

How it works

HTML files are full of whitespace and comments that make the source readable but add weight the browser doesn't need. Minifying removes HTML comments and collapses the runs of spaces and line breaks between tags, trimming the download without changing how the page renders.

This minifier is careful with content where whitespace matters: the contents of <pre>, <textarea>, <script>, and <style> are preserved exactly, and conditional comments (<!--[if …]-->) are kept. It reports the bytes saved so you can gauge the benefit.

Everything runs in your browser. For a full site, running minification as part of your build gives the most consistent results, but this is perfect for quick one-off optimisation and inspecting how much a page can shrink.

Examples

Indented markup → tags packed together with no gaps.
HTML comments removed, but <pre> content left untouched.
See the percentage saved before shipping a landing page.

Frequently asked questions

Will minifying break my page?
No. It preserves whitespace-sensitive elements (pre, textarea, script, style) and only removes ignorable whitespace and comments elsewhere.
Are conditional comments kept?