Saltar al contenido
NewKitApp

Buscar herramientas

Salta a cualquier herramienta por su nombre

HTML Minifier

Strip comments and unnecessary whitespace from HTML to shrink file size.

¿Qué es HTML Minifier?

An HTML minifier strips the parts of a document that exist purely for human readability — comments and the extra whitespace between tags — without changing how the page renders, shrinking the file that has to be downloaded and parsed. This matters most for pages generated once and served many times (a static export, an email template, a widget embedded on someone else's site) where every byte saved is bandwidth saved on every future request. This tool runs entirely in your browser and is careful about what it touches: content inside <script>, <style>, <pre>, and <textarea> is left completely untouched, because whitespace inside those elements is meaningful — collapsing it would break JavaScript syntax, CSS formatting, preformatted text, or a textarea's default value.

Cómo usar HTML Minifier

  1. Paste your HTML into the input box.
  2. The minified result appears instantly on the right, along with how many bytes and what percentage it shrank by.
  3. Click "Copy" to grab the minified output.

Ejemplos

Comments and whitespace

Entrada: <div> <!-- note --> <p>hi</p> </div>

Salida: <div><p>hi</p></div>

Text node with extra spacing

Entrada: <p>hello world again</p>

Salida: <p>hello world again</p>

Errores comunes

  • Minifying, then trying to debug the output directly — minified HTML is meant for production delivery, not for reading; keep your original, readable source and only minify at build/deploy time.
  • Assuming this also minifies inline CSS/JS syntax itself (removing unnecessary characters inside a <script> or <style> block) — it doesn't; it only removes HTML-level whitespace and comments, and deliberately leaves script/style bodies untouched.
  • Running already-minified output back through the tool expecting further savings — there's little left to strip once whitespace and comments are already gone.
  • Forgetting that HTML comments containing conditional logic some old tools relied on (like legacy IE conditional comments) are stripped along with ordinary comments — if you still need those for a specific legacy use case, keep an unminified copy.

Por qué usar esta herramienta

  • Processes entirely client-side — nothing you paste is sent to a server.
  • Protects <script>/<style>/<pre>/<textarea> content instead of blindly collapsing all whitespace.
  • Shows exactly how many bytes and what percentage you saved on your specific input.
  • No build tooling or configuration required — paste and get a result immediately.

Preguntas frecuentes