Choose language

Recently used

    Open a tool and it will appear here.

    HTML Minifier

    Minify HTML code by removing comments and whitespace

    Preserves preformatted text. Choose Safe, Recommended or Aggressive to control the original minification rules.

    Processed on this device. Your text is not uploaded.

    Compression results

    Original size
    —
    Minified size
    —
    Bytes saved
    —
    Reduction
    —

    How to use HTML Minifier

    Paste your code into "Input HTML", choose Safe, Recommended or Aggressive in "Minification level", and read the savings under "Compression results". Click "Copy" or "Download" to take the result as minified.html. Pick Recommended unless you have a reason not to. Safe only collapses whitespace, and Aggressive also omits closing tags the HTML rules allow you to leave out, which saved 19 more bytes on the sample page. Minifying can break a page in edge cases, so compare the output in a browser before you deploy, most of all at Aggressive. Nothing is uploaded.