HTML Minifier
Safely remove comments and extra whitespace between tags to shrink your HTML.
Lighter HTML, faster pages
Comments, indentation and line breaks added during development increase the size of HTML files. The HTML Minifier removes them to reduce the data sent to the browser and help pages load faster.
Safe minification
- HTML comments are removed
- Extra whitespace between tags is collapsed
- The contents of script, style, pre and textarea blocks are left untouched
Your code, code samples and form content stay intact. Use the CSS and JavaScript minifiers for inline styles and scripts. Processing happens in your browser.
How to use HTML Minifier
- Paste your HTML code.
- The minified output appears instantly.
- Check how much size was saved.
- Copy the result.
Why use this tool?
Minify static pages, email templates and HTML snippets without a build tool.
FAQ
Does it break inline scripts?
No. Script and style contents are kept as they are; use the CSS and JavaScript minifiers for those.
Are IE conditional comments kept?
All HTML comments are removed; add old IE conditional comments back by hand if you need them.
Does minifying affect SEO?
Visible content doesn't change; a smaller page contributes positively to speed metrics.
Related tools
CSS Minifier
Shrink your CSS files by removing comments and unnecessary whitespace.
Open toolJavaScript Minifier
Safely strip comments and indentation from JavaScript for smaller files.
Open toolXML Formatter and Validator
Indent XML documents for readability and check that they're well-formed.
Open toolMeta Tag Generator
Create title, description, robots, canonical and viewport meta tags with correct escaping.
Open tool