How html minifier works
HTML minification shrinks a page by removing comments and the whitespace browsers do not need between tags. The minified page is functionally identical but smaller, so it downloads and renders faster, which improves page speed and Core Web Vitals.
This minifier removes <!-- ... --> comments, collapses runs of whitespace to a single space, and strips spaces around tag brackets. Crucially, it preserves the content of <pre>, <textarea>, <script>, and <style> blocks, where whitespace and line breaks are significant and removing them would change the output.
Paste your HTML and click Minify. The tool reports the original size, the minified size, and the saving in bytes and as a percentage. For a full production pipeline you may also want to minify inline CSS and JS (use the CSS and JavaScript Minifier tools) and gzip the output on the server.