Langsung ke konten utama
Tools Star Hub

Minifier HTML

Perkecil HTML di browser Anda dengan proses hati-hati yang mempertahankan isi pre, textarea, script, dan style.

Memuat alat…

Alat ini berjalan di browser Anda. Input, file, dan nilai yang dihasilkan tetap di perangkat ini. Favorit dan alat yang baru dipakai, jika Anda menggunakannya, hanya menyimpan nama alat di penyimpanan lokal — tidak pernah kata sandi, dokumen, atau isi kode QR. Lihat kebijakan privasi.

Untuk saat ini, panduan lengkap alat ini (cara pakai, contoh, dan FAQ) masih dalam bahasa Inggris.

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.