Naar de hoofdinhoud
Tools Star Hub

HTML-minifier

Minificeer HTML in je browser met een voorzichtige bewerking die pre-, textarea-, script- en style-inhoud behoudt.

Tool laden…

Deze tool werkt in je browser. Invoer, bestanden en gegenereerde waarden blijven op dit apparaat. Favorieten en recent gebruikte tools bewaren, als je ze gebruikt, alleen toolnamen in de lokale opslag — nooit wachtwoorden, documenten of QR-inhoud. Lees het privacybeleid.

De uitgebreide handleiding voor deze tool (gebruik, voorbeelden en veelgestelde vragen) is voorlopig in het Engels.

What this tool does

Remove HTML comments and collapse spaces between tags. Use it when page source should be smaller before you publish. Text inside pre, textarea, script, and style is left alone, and more than 400,000 characters is refused.

How to use

  1. Paste HTML source into the left box.
  2. Press Minify. Character counts and an estimated reduction appear when there is output.
  3. Copy the result or clear both boxes.

Examples

  • Ordinary markup

    Comments are removed and extra whitespace between tags is collapsed.

  • Whitespace-sensitive tags

    Content inside pre, textarea, script and style is left alone so formatting there is not destroyed.

How it works

This is a conservative minifier. It strips HTML comments and collapses whitespace outside preserved elements. Quoted attributes are kept. It does not rewrite the DOM, and it does not claim that every HTML document will behave identically after minification—especially pages that depend on formatting outside pre/textarea/script/style.

Limitations

Comments are removed and spaces between tags are collapsed. Text inside pre, textarea, script, and style is left as it was. Markup that depends on spaces anywhere else can still change. More than 400,000 characters is refused.

See the disclaimer for what these tools do not cover.

FAQ

Is the HTML Minifier free?
Yes. Minifying HTML in this browser is free, and you do not need an account.
Is the minified HTML always equivalent?
No. The pass is intentionally conservative, but HTML that depends on whitespace in unexpected places can still change. Check the result before publishing.
Is my input sent to a server?
No. The HTML is minified in this tab. It is not uploaded and not written to local storage.
Does minifying HTML improve page speed?
It makes the file smaller, which can help a little, especially without compression. Servers that already use gzip or Brotli see a smaller gain.
What does an HTML minifier remove?
This one removes comments and collapses spaces between tags, while leaving the contents of pre, textarea, script, and style unchanged.