White space is content in four places
A browser collapses every run of white space in ordinary text, which is why a minifier may do the same. The exception is the elements whose rendering rule is white-space: pre: pre, textarea and, by default, script and style. Inside those, one space is one space, and a newline is a newline. Everything else about minifiers follows from that rule, including why this one copies those four blocks rather than re-indenting them.
The other fragile space is between inline elements
<span>one</span> <span>two</span> shows a gap; remove the space and it reads onetwo. The same is true for links, emphasis and anything else with display: inline. A minifier that removes every white-space run between tags is a minifier that has broken a sentence somewhere. This one keeps one space whenever text is on either side of the run, and drops it only between two tags.
| Markup | What a browser shows | Safe to remove the space? |
a</span> <span>b | a b | No |
<div> <div> | nothing | Yes |
<pre> a </pre> | a, with a leading space | No |
<li> a </li> | a | Yes, at the edges |
Comments that are not comments
A conditional comment, <!--[if lt IE 9]>, is read as markup by old Internet Explorer and as a comment by everything else. Removing it can change what an old browser renders, which is a support decision rather than a size one. A comment that starts with an exclamation mark, <!--! license -->, is a licence notice by convention, and a tool that strips licences quietly is a tool that gets someone into trouble. Both are kept.
What a formatter changes, and what it must not
Indentation and line breaks are white space, so a formatter can invent them freely, with the same four exceptions. What it must not do is reorder attributes, rewrite a tag name to lower case, or close a tag the author left open. The first two change how a document reads in review; the third changes the document. The formatter here writes tags as they were written, and the checks report an unclosed tag instead of quietly fixing it.
Reading the numbers
The byte count is the honest one: UTF-8 bytes, the same number the server sends before compression. A well-structured HTML page often loses fifteen to thirty percent to minification, and a page of mostly text loses less, because the text is the content. The gzip figure matters more than the raw one for anything over a few kilobytes: compression already removes the repeated white space and tag names, so minifying a gzipped page saves less than the raw percentage suggests. Both are shown for the input and for the output, so the second comparison is the one to make.
What this page will not catch
A validator knows the content model of every element: which children a ul may have, which attributes belong on an img, whether a meta belongs in the body. This page checks a handful of those rules, the ones that break a page or an accessibility audit most often, and says so. For a full pass, the W3C validator is still the tool, and a browser's accessibility tree is still the test that matters.
For the CSS side in more depth, Pikkola CSS generates shadows and glass panels with the same rules. For a document whose size is the problem, Pikkola SVG does the same job for a vector file.