HTML Minify
Strip comments and unnecessary whitespace from HTML, live as you type.
<!doctype html><html><head><title>Page</title></head><body><h1>Hello</h1></body></html>Strips comments and collapses whitespace live as you type. If your markup relies on preserved whitespace inside a <pre> or <textarea>, check the output — this tool collapses that too rather than special-casing those elements. Runs entirely in your browser.
What is HTML Minify?
Paste HTML and get it minified instantly — comments and inter-tag whitespace stripped, output shrunk for production without changing the rendered result. Smaller HTML means fewer bytes over the wire on first load, which matters most on a mobile connection or a page with a lot of markup. Minification runs entirely in your browser, so the source never has to be uploaded to a third-party service.
FAQ
No — this tool collapses whitespace everywhere, including inside elements where it's meaningful. Check the output if your markup relies on preserved whitespace in those elements.
Yes — regular comments are removed. If you rely on conditional comments or a templating system that repurposes comment syntax, review the output before using it.