About HTML minification

HTML minification reduces page size by removing comments, unnecessary whitespace, and line breaks, which speeds up loading and saves bandwidth.

The tool performs safe transforms: removes comments (except conditional IE comments), compresses whitespace between tags, and optionally removes empty attributes. Document structure remains correct.

For automation in large projects, use html-minifier or similar tools in your build. This tool is handy for quick optimization of individual files or checking minification results.

How to use

  • 1

    Paste code

    Copy your HTML into the top field or write markup manually.

  • 2

    Pick options

    Enable comment removal, whitespace compression, and empty attribute removal as needed.

  • 3

    Minify

    Click Minify — result will appear below.

  • 4

    Save

    Copy the result or download `.min.html`.

FAQ