Small HTML fragments often contain comments and indentation that are useful while editing but unnecessary in a distributed copy. The HTML Minifier parses HTML in the browser, removes ordinary comments, and collapses repeated whitespace outside protected elements. Keep the readable source as your master and treat the result as a separate artifact to test.
Paste one self-contained source block
Enter your markup in Source code and choose Minify code. The implementation accepts up to 250,000 UTF-8 bytes per operation. The byte count is checked after encoding, so text with non-ASCII characters may use more bytes than its visible character count suggests.
The result reports Input bytes and Output bytes, shows the compacted markup, and offers a minified.html download. These figures compare uncompressed text. They do not measure network compression, page rendering speed, or the total size of a site.
Follow a simple whitespace example
For input <p>Hello there</p><!-- editor note -->, the result is <p>Hello there</p>. The repeated spaces inside the paragraph collapse to one, and the ordinary comment is removed. The tool does not simply delete every space: a single separating space remains in text where the rule applies.
Contents of script, style, pre, and textarea elements retain their whitespace. That protects preformatted text and embedded source from this whitespace pass. It does not minify the CSS or JavaScript inside those elements. Use the CSS Minifier or JavaScript Minifier separately when you need those transformations.
Account for the browser parser
Because the source passes through DOMParser, the output is normalized HTML rather than a byte-preserving rewrite. The parser may repair malformed markup and serialize elements differently. A document containing an HTML, head, or body tag is serialized as a full document; a fragment is returned from the parsed head and body contents. A leading doctype is normalized to <!doctype html>.
Most comments are removed, while comments beginning with the implementation’s conditional-comment pattern are retained. Do not use the minifier as a sanitizer, security validator, or a way to remove every kind of hidden data. The page does not execute the submitted code, but generated markup still needs its own review before insertion anywhere.
Processing stays in the browser without uploading your source to ERITHRA. Keep confidential code out of public examples and retain the original file. Render the output in its intended page and compare text spacing, form values, styling, and scripts before deployment; whitespace changes can matter in contexts that this general rule cannot infer.