HTML Minifier Online
Shrink a page's HTML without changing how it renders. Nothing is uploaded or stored.
Minify
Paste HTML first.
Result
Preview — the minified page rendered
If the preview looks the same as the original page, the minification is safe.
How the minifier works
Removed. Comments, and whitespace between tags where it cannot change the text — a space between two inline elements (a and b) is kept.
Never touched. Everything inside <pre>, <textarea>, <script> and <style> is byte-identical.
Optional. Attribute quotes are stripped only when the value has no spaces or special characters and does not end in /. Optional closing tags are only removed where the HTML rules allow it.
Local only. All work happens in your browser. Nothing is uploaded, stored or shared.
How to use
- Enter your details in the boxes above: HTML, Or upload a .html file, Strip attribute quotes where safe.
- Use the html minifier online controls to adjust any options the tool offers.
- Press Load example or change a value, and the result updates on the page.
- Check the result, then copy, download or print it using the buttons shown, if the tool offers them.
About this tool
This html minifier online is a free tool that works directly in your browser, with no sign-up and nothing to install. Comments, and whitespace between tags where it cannot change the text — a space between two inline elements (a and b) is kept. Everything inside
,