Minificateur HTML
Retirez espaces, commentaires et guillemets du HTML - avec un rapport avant/après dans votre navigateur.
Collez du HTML, obtenez une version minifiée - avec compteur d'octets et pourcentage économisé. Commentaires et blancs retirés par défaut ; options pour retirer guillemets d'attributs et balises facultatives.
Comment l'utiliser
Paste your HTML
Any HTML5 fragment or full document.
Pick aggressiveness
Default trims whitespace + comments. Aggressive also strips redundant quotes and optional tags.
Copy the minified output
Before/after byte counts shown next to the output.
Qu'est-ce que c'est ?
An HTML minifier shaves bytes off an HTML document by removing whitespace and comments that don't affect rendering. The wins are biggest on hand-authored HTML with generous indentation; framework-generated output is usually already compact. Typical savings: 15-30% on raw HTML before gzip.
Quand l'utiliser
Inlining HTML into a JSON response or an email template where every byte counts. Hand-optimising a critical-path page after a Lighthouse audit. Cleaning up exported HTML from a WYSIWYG editor that left a comment on every line.
Erreurs courantes
Running it on Jinja / Handlebars / Vue templates - the minifier doesn't understand template tags, so {{ stuff }} survives but the surrounding whitespace might disappear in unwanted places. Removing comments that the build pipeline actually needs (build-info pragmas, IE conditional comments). And expecting big wins on already-gzipped output - HTML minification stacks with gzip but the gzip pass does most of the heavy lifting.
FAQ
- Does it preserve <pre>, <textarea> and <code>?
- Yes. Whitespace inside these tags is meaningful, so it's left intact. Same for <script> and <style> bodies.
- Is the output still valid HTML?
- Yes for the default options - we only remove whitespace where it can't change rendering. With 'remove optional tags' on, the output is more compact but relies on HTML5's optional-element rules, so be sure your parser is HTML5-compliant.
Outils similaires
Plus dans cette catégorie
- Formateur et validateur JSON
- Encodeur / Décodeur Base64
- Encodeur / Décodeur d'URL
- Générateur de hachage (SHA-1, SHA-256, SHA-384, SHA-512)
- Décodeur JWT
- Testeur de regex
- Convertisseur Markdown vers HTML
- Convertisseur YAML vers JSON
- Convertisseur CSV vers JSON
- Formateur SQL
- Encodeur / Décodeur d'entités HTML
- Lecteur d'expression cron
- Formateur XML
- Générateur de données fictives
- Générateur de tableau Markdown