← Back to Tools

HTML Minifier

Strip bloat from production markup. Faster pages, better scores.

Minification Options
Source HTML 0 B
Minified Output 0 B
Original Size
Minified Size
Savings
Note: Inline <script> and <style> blocks are minified separately — attribute values, URLs, and event handlers are never corrupted. For full AST-level tree-shaking, pair with a build tool like Vite or Parcel.

Why Minify HTML?

Every byte you send over the wire costs time. On mobile connections, bloated markup delays First Contentful Paint and hurts your Core Web Vitals score — which Google uses directly as a ranking signal. HTML minification removes everything a browser doesn't need: comments, redundant whitespace, and optional quotes that inflate file size without changing how the page renders.

What gets removed?

HTML comments, inter-tag whitespace, redundant attribute quotes, and optional closing tags for elements like <li> and <p>. Inline <script> and <style> blocks are compressed independently without corrupting string literals.

Is it safe for production?

Yes — with one rule: always keep your original source file. Minification is not reversible. Pair this tool with version control or keep a /src folder of clean originals for development.

100% Private

Your markup is processed entirely inside your browser using JavaScript. Nothing is uploaded to a server, logged, or cached. Close the tab and it's gone.