Minify HTML
minify html. Strips comments and collapses whitespace via regex, not a real parser (might mishandle markup-like sequences inside string/attribute values). JS minification isn't offered here: doing it safely needs a real parser this task can't add. Runs on your device.
Runs on your device. The file is never uploaded.
Minify HTML deletes <!-- --> comments, drops the whitespace between tags and joins the markup onto one line. There are no options at all, and dropping several files prints each result in turn. Nothing shields pre, textarea, script or style, so an inline // comment swallows the code that followed it.
Questions
What does it strip out?
Comments between <!-- and -->, then whitespace between tags, then runs of spaces and tabs collapsed to one, then newlines together with the indentation that follows them. Tags, attributes and text are otherwise untouched: nothing is renamed, no attribute quotes are removed and no optional closing tags are dropped.
Does it protect pre, textarea, script and style?
No, and this is the main thing to watch. The passes run over the whole document, so significant whitespace inside a pre or textarea is collapsed and inline scripts and styles are flattened onto one line. A // comment inside an inline script will then swallow whatever followed it on the next line.
Will it change how my page renders?
It can, anywhere whitespace was doing work. The space between two inline elements separated by a newline is real, and removing it closes a gap the browser was drawing. If your layout leans on that space, insert a non-breaking space or restructure the markup before minifying.
How is this different from the XML minifier?
It is not. Minify HTML and minify XML run the same routine: both strip <!-- --> comments and collapse whitespace between and inside tags. They are listed as two tools because that is what people search for, not because the rules differ.
Do I get a file or text back?
Text on the page. The minified markup is printed rather than handed back as a download, and if you drop several files their results appear one after another in the order you dropped them. There are no options at all, so the same input always gives the same output.
Does it use a real HTML parser?
No, four regular expressions. That is fast and needs no dependency, and it is exactly why the caveats above exist: a sequence that looks like a comment or a tag boundary inside an attribute value or a text node is treated as one. For templates and everyday markup it is fine; check anything unusual.