メインコンテンツへスキップ
Tools Star Hub

HTML圧縮ツール

pre、textarea、script、styleの内容を保持する慎重な処理で、HTMLをブラウザ内で圧縮します。

ツールを読み込み中…

このツールはブラウザ内で動作します。入力内容、ファイル、生成した値はこの端末に残ります。お気に入りと最近使ったツールを利用する場合も、ローカルストレージに保存されるのはツール名だけで、パスワード、文書、QR コードの内容は保存されません。 詳しくはプライバシーポリシーをご覧ください。

このツールの詳しい解説(使い方、例、よくある質問)は、現在英語のみでご用意しています。

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.