Toolvist

Minificador HTML

Minifica HTML online: elimina espacios, comentarios y atributos redundantes para reducir el peso de la página. Compresor HTML gratuito, sin subidas ni build.

Minificador HTML online y gratuito

El minificador HTML elimina comentarios y reduce el espacio en blanco entre etiquetas para aligerar tu marcado. El contenido de los elementos pre, textarea, script y style se conserva exactamente.

Minification is the last step before deployment, so the result is worth checking with the HTML Formatter & Beautifier and the Broken Link Checker List. The CSS and script assets alongside it are handled by the CSS Minifier and JavaScript Minifier.

Cómo usar Minificador HTML

  1. 1 Paste your HTML, or load a file.
  2. 2 Choose how aggressive to be: whitespace-only, or whitespace plus optional tag and attribute removal.
  3. 3 Check the reported size saving before you commit.
  4. 4 Copy the minified output, and test the page afterwards — minification can expose a bug in sloppy markup.

Cómo usarlo

Pega tu HTML y pulsa Minimizar. El marcado compacto aparece a la derecha.

  • Elimina los comentarios HTML
  • Quita el espacio en blanco entre etiquetas
  • Protege el contenido de pre, textarea, script y style

Preguntas frecuentes

What does HTML minification actually remove?

Whitespace between block elements, comments, and optionally redundant attributes such as a `type="text/javascript"` on a script tag or a default `type` on a stylesheet link. It may also remove optional closing tags, since HTML allows certain elements to omit them. None of it changes what the document means.

Why did my layout break after minifying?

Because whitespace between inline elements is significant. Minification collapses the space between, say, two `<span>` elements or between two inline images, and if the layout relied on that space to separate them they will jump together. This is the one genuine hazard, and it only affects inline content.

Does minifying HTML worthwhile compared with gzip?

Far less than people expect, because a web server already compresses HTML on the wire and gzip removes most of what minification would. The redundancy minification targets — repeated tag names, consistent indentation — is exactly what a compression algorithm is good at. Minify for tidiness or if you are serving uncompressed, not as a size strategy on its own.

Herramientas para desarrolladores relacionadas

Ver todo en Herramientas para desarrolladores →

También te puede interesar

Herramientas de otras categorías que suelen combinarse con Minificador HTML:

Explorar el directorio completo →