HTML Minifier

Minify HTML by removing comments, collapsing whitespace, and optimizing attributes.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

dropHint

What is HTML Minifier?

A tool that compresses HTML files to reduce their size. You can individually toggle options such as comment removal, whitespace collapsing, empty attribute removal, boolean attribute shortening, and inline CSS compression. Useful for improving page load speed and reducing HTTP response size.

How to Use

  1. Paste your HTML into the input field.
  2. Select the minification options (defaults are set to common safe settings).
  3. Click "Minify" to get the compressed HTML.
  4. The reduction percentage and saved bytes are shown in the output header.
  5. Click "Copy Result" to copy to clipboard.

FAQ

Is removing attribute quotes safe?

Only when the value contains no whitespace or special characters. It is disabled by default for safety. Always verify in your target environment before deploying.

How far does inline JS minification go?

Only line/block comment removal and whitespace collapsing are performed. Variable name mangling is not done. For complex JS, use a dedicated minifier like Terser.

Are script, style, pre, and textarea contents processed?

script and style tags are processed only when the inline JS/CSS minification options are enabled. pre, textarea, and code tag contents are always preserved as-is.

Are IE conditional comments removed?

No. Conditional comments like `<!--[if IE]>` are preserved even when the remove-comments option is enabled.

Is my data sent to a server?

No. All processing happens entirely in your browser.