RevealTheme logo

HTMLミニファイア(圧縮ツール)

HTMLから空白とコメントを取り除きます。埋め込みコード、メールのテンプレート、本番環境のHTMLに役立ちます。

このツールの使い方

  1. 1

    Paste your HTML — a fragment, a component, or a small template.

  2. 2

    The minified result and the new byte count appear instantly below.

  3. 3

    Copy the minified HTML for your embed, email, or snippet.

HTMLミニファイア(圧縮ツール)とは何ですか?

HTMLの圧縮(ミニファイ)は、コメントを取り除き、空白を折りたたみ、不要な属性を削除することでファイルサイズを削減します。本番環境では、ビルドツール(html-minifier-terser)を使ってください。このツールは、ビルドツールが実用的でない、単発のスニペットやメールのテンプレートに対応します。

よくある活用例

  • Compress a simple HTML email template, where size affects deliverability and there's no build pipeline.

  • Minify a plain embed or widget snippet that gets pasted onto many external pages.

  • Trim server-rendered HTML fragments returned by an API or AJAX endpoint on every request.

  • Remove developer comments from markup before it's exposed in a public 'View Source'.

  • Shrink a small static HTML file you're hosting directly without a bundler.

  • Quickly see how much weight comments and whitespace add to a chunk of markup.

よくある質問

圧縮するとレイアウトが崩れますか?
ほとんどの場合は安全ですが、空白が重要となる<pre>、<code>、<textarea>には注意してください。
インラインのスクリプトも圧縮すべきですか?
JS専用のミニファイアを別に使ってください。HTMLのミニファイアはスクリプトの内容には手を加えません。

関連ツール