HTML minifier
Minify HTML by removing unnecessary comments, spaces and line breaks, keeping <pre>, <textarea>, scripts and styles intact, with the byte savings.
How to usePaste the HTML to minify.
HTML minifier: what it is for
Paste HTML to remove unnecessary comments and spaces and make the page lighter. The contents of pre, textarea, script and style are preserved, and the tool shows the size before and after.
The code isn't sent to any server: the conversion happens in your browser.
How to use
- Paste the HTML.
- Choose what to remove.
- Copy the minified HTML.
When to use it
- Making pages and HTML emails lighter.
- Reducing template size.
- Preparing HTML to embed in another system.
Frequently asked questions
Can minification break the page?
The contents of <pre>, <textarea>, <script> and <style> are preserved, and one space is kept between text elements. Still, check the page afterwards, especially if the layout depends on spaces between inline elements.
How much smaller does the page get?
It depends on the code. Well-indented HTML with lots of comments usually shrinks by 10% to 30%. The tool shows the exact savings.