HTML Minifier

Minify HTML code by removing comments and whitespace

Share this tool

Report a problem

Describe the problem without including private input or files.

How useful was this tool?

How useful was this tool?

Preserves preformatted text. Choose Safe, Recommended or Aggressive to control the original minification rules.

Processed on this device. Your text is not uploaded.

Compression results

Original size
—
Minified size
—
Bytes saved
—
Reduction
—

About HTML Minifier

The HTML Minifier is a free online tool that reduces the file size of your HTML code by removing unnecessary characters without changing its functionality. HTML minification strips out whitespace, comments, empty attributes, and optional closing tags, resulting in smaller files that load faster and consume less bandwidth.

Minified HTML loads faster because browsers need to download less data. For high-traffic websites, even small reductions in file size can significantly reduce bandwidth costs and improve user experience. Studies show that minification can reduce HTML file sizes by 10-30%, directly impacting page load times and Core Web Vitals metrics.

Our tool offers three minification levels: Safe (basic whitespace compression only), Recommended (removes comments, whitespace, and empty attributes while minifying inline CSS & JS), and Aggressive (maximum compression including removal of optional HTML5 closing tags). Real-time compression statistics show you exactly how much space you saved.

Privacy settings

Choose your preferences for analytics, advertising and personalization. Essential storage keeps features such as your theme and saved tools working.

Essential storage is always enabled.