Skip to main content

HTML Minifier

Minify HTML locally by removing comments and extra whitespace.

Tool workspace

Minify HTML in your browser by removing comments and extra whitespace. Contents of script, style, pre, textarea, and code are preserved. Markup is not executed or uploaded. Not a bundler-equivalent build step.

How it works

Paste HTML, then Minify.

Minification runs entirely in your browser: HTML comments and unnecessary whitespace are removed while the contents of script, style, pre, textarea, and code blocks stay intact. Markup is never executed, injected into the page, or uploaded.

Empty input clears the result—no error. This is not a full HTML validator or a production bundler (html-minifier-terser) equivalent.

Examples

  • <div> <p>Hi</p> </div> → <div><p>Hi</p></div>
  • <!-- comment --> removed
  • Script / style / pre / textarea / code inner whitespace preserved
  • Status shows before → after character counts when useful

Privacy

Privacy: this tool processes HTML locally in your browser. We do not log or store what you paste. Login is not required.

FAQ

Is my HTML uploaded?

No. Minification runs entirely in your browser. We do not log or store what you paste.

Will this match my bundler’s HTML minifier?

Not necessarily. This is a safe best-effort minifier for pasted markup, not a production build pipeline.

Do I need an account?

No. All published tools work for guests without login.