HTML Minifier
Minify HTML code by removing unnecessary whitespace.
Make HTML smaller by removing comments, unneeded whitespace between tags and empty class or style attributes. Paste HTML and get a compact version with the size saving shown. Whitespace inside pre, textarea, script and style elements is kept, so code blocks and form text look the same. It's useful for email templates, embedded snippets and static pages where every kilobyte counts.
Common use cases
- Shrink an HTML email template under a size limit
- Minify a widget or snippet before embedding it
- Reduce the size of a static HTML page
- Strip comments before sharing HTML
How to use
- Paste your HTML.
- Choose whether to remove comments and empty attributes.
- Copy or download the minified HTML.
FAQ
Will minifying break my page?
Rarely. Spaces between inline elements can matter for layout, so check the result. Conditional comments for old Outlook versions (<!--[if mso]>) are kept even when other comments are removed.
Does it minify inline CSS and JavaScript?
No. Use the CSS minifier and JS minifier for those.
How do I make HTML readable again?
Use the HTML formatter.
Related tools
- CSS MinifierMinify CSS code by removing whitespace and comments.
- JS MinifierMinify JavaScript code to reduce file size.
- HTML FormatterBeautify HTML code with proper indentation and formatting.
- SQL FormatterFormat and beautify SQL queries with proper indentation.
- JSON FormatterFormat, validate, and beautify JSON data with syntax highlighting.
- XML FormatterFormat and indent XML documents for better readability.