HTML Minifier

Compress HTML by removing whitespace, comments, and optional tags

Frequently Asked Questions

What does HTML minification do? +
HTML minification removes unnecessary characters from your HTML — extra whitespace, line breaks, comments, and optional closing tags — without changing how the page renders. This reduces file size and improves page load times.
Is my HTML sent to a server? +
No. All minification happens entirely in your browser using JavaScript. Your HTML never leaves your device — nothing is uploaded or stored anywhere.
Will minification break my page? +
No. The minifier only removes whitespace and comments that browsers ignore anyway. It preserves all content inside pre, textarea, script, and style tags where whitespace matters. Your page will render identically.
What are optional closing tags? +
Certain HTML elements like li, p, td, th, tr, thead, tbody, and tfoot have optional closing tags per the HTML spec. Browsers render them correctly without the closing tag, so removing them saves bytes without affecting the page.
How much space can I save? +
Savings depend on how much whitespace and comments are in your original HTML. Typical savings range from 10-30% for hand-written HTML. Already-compact HTML may see smaller gains. The tool shows exact before/after sizes and savings percentage.
Copied to clipboard!