Use HTML Minifier
Uses an HTML-aware minifier. Start with the sample, select the options and run the tool. Copy or download the result after reviewing it.
Behavior and limits
Uses an HTML-aware minifier. Conservative whitespace collapsing preserves separation between words and preformatted text. Inline JavaScript and CSS are not executed or minified. Choose whether to remove comments.
Example input
<!-- Example -->
<main>
<h1> Hello world </h1>
<pre> keep
whitespace </pre>
</main>
Expected behavior for the example
Removes the Example comment by default and collapses ordinary spacing; the preformatted block retains its line break and spaces.
Check important output in the application that will consume it. Use the tool directory to find related formats and tasks.
Frequently asked questions
How does HTML Minifier handle my input?
Uses an HTML-aware minifier. Conservative whitespace collapsing preserves separation between words and preformatted text. Inline JavaScript and CSS are not executed or minified. Choose whether to remove comments.
Is my input uploaded or saved automatically?
Processing runs locally in this browser. Input and results are not saved automatically. Downloads happen only when you choose them. The static preview blocks scripts and external resources when one is available.