HTML Minifier
Strip comments and collapse whitespace — safe for pre, textarea, and script tags.
Comments are stripped and whitespace collapsed. Content inside pre, textarea, and script tags is never touched.
Working…
Something went wrong
Your results will appear here.
Fill in the input above and run the tool to get started.
Honest limits
This tool removes HTML comments and collapses whitespace while protecting pre, textarea, and script content. Minification reduces file size and helps page speed; it is one optimization among many and does not guarantee ranking improvements.
How to use the HTML Minifier
- Paste your HTML source into the input box.
- Press Minify HTML — comments are stripped and whitespace collapsed.
- Check the byte savings, then Copy minified HTML and deploy it.
Examples
Example
An indented 248-byte fragment with two developer comments minifies to 171 bytes — 77 bytes saved (31%) — while a <pre> code sample inside stays byte-identical.
What this tool doesn't do
- Only comments and whitespace are removed — this is not a full HTML optimizer (no attribute shortening or tag cleanup).
- Content inside
<pre>,<textarea>, and<script>is deliberately left untouched. - Minification trims the HTML document; oversized images and render-blocking scripts are usually the bigger speed problem.
Frequently asked questions
Related tools
Slug Generator
Turn any title into a clean, SEO-friendly URL slug — lowercase, hyphenated, accent-free.
Use toolHeading Analyzer
Paste your HTML and audit the H1–H6 hierarchy — catch skipped levels and empty headings.
Use toolMeta Tag Generator
Generate SEO, Open Graph and Twitter Card tags.
Use toolOpen Graph Generator
Build perfect Open Graph and Twitter Card meta tags with a live social-share preview.
Use toolSERP Preview Tool
See exactly how your page appears in Google results — live preview with truncation warnings.
Use toolReadability Analyzer
Flesch Reading Ease and grade-level scores — with long-sentence and passive-voice flags.
Use tool