Remove ordinary HTML comments and outer whitespace without rewriting text, scripts, styles or template content.
Result will appear here...
<!-- remove this comment -->
<div>
<h1>Title</h1>
</div>
Output:
<div>
<h1>Title</h1>
</div>
This conservative HTML minifier removes ordinary comments and whitespace around the whole document. It intentionally preserves internal whitespace because spaces between inline elements, content in <pre>, scripts, styles and template fragments can be meaningful.
For production builds, use an HTML-aware parser with settings matched to your framework. This tool favors preserving behavior over claiming the smallest possible output.