HTML Minifier with Live Size Savings
Minify HTML in your browser and see exactly how many bytes you save. Safely comp...Minify HTML in your browser and see exactly how many bytes you save. Safely compresses without touching pre, script, style or textarea blocks.
Updated
Minified HTML will appear here...Quick answer
An HTML minifier shrinks a page by removing comments and collapsing whitespace between tags, without changing how it renders. Paste your HTML here and it minifies instantly in your browser, showing the original size, the minified size and the exact bytes and percent saved. It safely preserves pre, textarea, script and style blocks byte for byte, keeps IE conditional comments, protects quoted attribute values, and lets you copy or download the .html.
HTML Minifier Features
Why Use HTML Minifier with Live Size Savings?
See the Savings Live
Original size, minified size and the exact bytes plus percent saved update as you paste. No guessing how much smaller your HTML got.
Safe by Design
A tokenizer protects pre, textarea, script and style blocks plus every quoted attribute value, so the minified HTML renders identically to the source.
Keeps Conditional Comments
IE conditional comments like [if IE] survive minification, and so do important comments you mark with an exclamation, while every other comment is removed.
Controls That Match the Job
Toggle remove comments, collapse whitespace and a conservative mode that keeps a single space between tags for inline layouts that need it.
100% In Your Browser
Your HTML never leaves the page. All processing runs client-side in JavaScript, so nothing is uploaded to a server.
Copy or Download .html
One click to copy the result or download it as a ready-to-ship index.min.html file for your production build.
What People Use the HTML Minifier For
Production Builds
Compress your final HTML before shipping so browsers download fewer bytes and pages render sooner.
Core Web Vitals
Smaller HTML cuts the bytes the browser must parse, helping LCP and your PageSpeed and Lighthouse scores.
Email Templates
Shrink HTML email templates to stay under client size limits and load faster in the inbox.
Faster Mobile Loads
Fewer HTML bytes matter most on slow mobile networks where every kilobyte affects load time.
How It Works
Paste Your HTML
Drop your markup into the input box, or click Load sample to try it. The minified output and size savings appear instantly.
Choose Your Options
Keep the defaults to remove comments and collapse whitespace, or turn on conservative mode to keep a single space between tags for inline elements.
Copy or Download
Copy the minified HTML to your clipboard or download it as an index.min.html file, then ship it for faster page loads.
Tips & Best Practices
Keep Your Source Readable
Keep the formatted HTML for development and only minify the output for production, so your code stays easy to edit.
Turn On Conservative Mode for Inline Layouts
If links or spans sit side by side and rely on the space between them, enable conservative mode so that single space is kept.
Minify CSS and JS Separately
This tool never touches script or style content. Compress those with the CSS and JS minifiers first, then minify the HTML.