HTML Minifier
Remove ordinary HTML comments and trim whitespace at the start and end of a snippet. This conservative minifier keeps text spacing, quoted attributes and raw-element contents intact so inline words do not run together.
-
Remove ordinary HTML comments and trim whitespace at the start and end of a snippet. This conservative minifier keeps text spacing, quoted attributes and raw-element contents intact so inline words do not run together.
See moreSee less about the HTML Minifier
Examples
Keep the word separator
<span>Hello</span> <span>world</span><!-- remove -->
Result: <span>Hello</span> <span>world</span>It preserves script, style, pre, title and textarea contents, conditional comments and comments beginning with <!--!. It does not minify JavaScript or CSS, collapse internal whitespace or remove optional tags. Unclosed comments, tags and raw elements return errors. Input limit: 100,000 characters.
Key features
- Ordinary comment removal
- Inline spacing preserved
- Copy output and compare bytes