Developer
HTML minifier
Shrink HTML by collapsing whitespace and removing comments.
Free to use · Runs in your browser · No signup
This tool works in your browser. Enable JavaScript to select files and create your download.
How to use HTML minifier
- Paste your HTML.
- Choose whether to remove comments.
- Copy or download the minified HTML.
What you need
Nothing to upload. Type or paste directly into the tool; results update as you go.
Your result
Minified HTML and the size saved.
Before you start
This is conservative: contents of pre, textarea, script, and style are left untouched, and conditional comments are kept. Check pages that rely on spaces between inline elements.
Questions about HTML minifier
How do I use HTML minifier?
Paste your HTML. Choose whether to remove comments. Copy or download the minified HTML.
What does HTML minifier produce?
Minified HTML and the size saved.
What should I check before using HTML minifier?
This is conservative: contents of pre, textarea, script, and style are left untouched, and conditional comments are kept. Check pages that rely on spaces between inline elements.
Is what I type sent anywhere?
No. The calculation runs in your browser, and the text or numbers you enter are not uploaded or stored.