Aller au contenu principal
Tools Star Hub

Minificateur HTML

Minifiez du HTML dans votre navigateur avec une passe prudente qui conserve le contenu de pre, textarea, script et style.

Chargement de l’outil…

Cet outil fonctionne dans votre navigateur. Les saisies, fichiers et valeurs générées restent sur cet appareil. Les favoris et outils récents, si vous les utilisez, n’enregistrent que des noms d’outils dans le stockage local — jamais de mots de passe, de documents ni de contenus QR. Consultez la politique de confidentialité.

Le guide détaillé de cet outil (mode d’emploi, exemples et FAQ) est pour l’instant disponible en anglais.

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.