About
Tool No. 76 of Pikkola, 27 November 2026
Markup is read by browsers forgivingly and by humans not at all. This page reads the same text twice: once to lay it out so a person can see the structure, and once to take every byte that a browser does not need. The same reader then answers the questions worth asking before a page ships.
What it does
- Formats HTML with an indent you choose, keeping pre, textarea, script and style content exactly as written.
- Formats CSS one declaration per line and one selector per rule, with at-rules and comments kept where they belong.
- Minifies both: comments and redundant white space out, quoting and conditional comments left alone.
- Reads the inline style block and the style attributes as CSS, so a page that carries its own rules is formatted as one document.
- Reports what usually breaks a page: unclosed tags, mismatched end tags, duplicate attributes and ids, images without alt text, a div inside a paragraph.
- Counts bytes, lines and tags before and after, for both directions, and exports the result as a file.
- Speaks English, Korean and Japanese. Nothing is uploaded, stored or sent.
What a formatter is allowed to change
Indentation and line breaks between elements are white space to a browser, so a formatter can add them freely. Inside a pre, a textarea, a script and a style element they are content, so the reader copies those blocks byte for byte and only moves them as a unit. The same rule decides what the minifier may collapse: text runs lose runs of spaces, but a code block keeps every one of them.
Where the minifier stops
A minifier that removes a space it should have kept breaks a page, so this one errs on the side of leaving things alone. Comments go, except a conditional comment that only old Internet Explorer reads and a comment that starts with an exclamation mark. Attribute quoting stays even when it could be dropped. The contents of script and style are left as the author wrote them, because minifying JavaScript without a parser is how bugs get shipped. CSS is minified, and so is the style attribute, where the rules are simple enough to keep exactly.
What the checks look for
An unclosed tag, an end tag with no start, an attribute written twice on one element, an id used twice in the document, an image without alt text, an anchor with an empty href, a block element inside a paragraph, a button without a type. These are the mistakes that a browser hides and a screen reader or a validator does not. Each finding names the line the element starts on.
The style block and the style attribute
A page that carries its own CSS is formatted as one document: the style block is formatted with the CSS rules and its result is written back inside the tag, and the style attribute is split into a declaration per line when it is long enough to read better that way. This is also why the CSS tab accepts a whole stylesheet on its own, for the case where the CSS lives in another file.
Why the counts matter
A page that is 30 percent smaller is a page that starts sooner on a phone, and the count is also the fastest way to see that a formatter or a minifier did something unexpected. The byte count is the exact number of UTF-8 bytes; the gzip figure, when the browser offers CompressionStream, is what the file costs on the wire. Both are shown for the input and for the output, so the difference is the number that matters.
What it is not
It is not a validator, a bundler or a template engine. It does not resolve includes, does not run a build step and does not pretty print JavaScript. It reads HTML and CSS the way a careful person does, says what looks wrong, and leaves the files it cannot parse exactly as they were.
Contact
A document this page formats badly is worth a message with the smallest snippet that shows it: hello@pikkola.com.