DevTilt

HTML Minifier

Shrink HTML by collapsing whitespace and stripping comments. Options stay conservative: attribute quotes are kept, and embedded scripts are not aggressively rewritten.

Result

Paste code, then Minify. Libraries load in your browser.

How to minify HTML

  1. Paste HTML.
  2. Click Minify (the minifier library loads on first use).
  3. Whitespace and comments are collapsed; attribute quotes are kept.
  4. Copy the compressed markup as text — it is not rendered on the page.

What is HTML Minifier?

HTML templates with whitespace and comments inflate page size, especially in email where every byte counts. This minifier removes unnecessary characters while keeping the DOM structure intact — a quick way to shrink snippets without running a full build step.

Why use DevTilt's HTML Minifier?

  • Removes comments, whitespace, and optional attribute quotes
  • Preserves document structure and semantics
  • Shows size reduction after minification
  • Handles inline scripts and styles within HTML

Common use cases

  • Shrinking an HTML email template for deliverability
  • Minifying a static landing page snippet
  • Reducing payload size for an embedded widget
  • Preparing compact HTML for a JSON API response field

FAQ

Attribute-quote removal, script/style type-attribute stripping, and embedded JS minify are off so markup stays safer to round-trip.
Comment removal is on. Conditional comments and IE leftovers are not preserved in this MVP.
No. html-minifier-terser runs locally in your browser.
Conservative options keep quotes and most attribute values intact. Review output if you rely on whitespace-sensitive pre blocks or unusual template placeholders.
No. Embedded script minification is disabled in this MVP so markup round-trips more safely. Minify scripts separately with the JavaScript Minifier if needed.