HTML Minifier
Shrink HTML to its smallest safe form: comments stripped, whitespace collapsed, and blank lines removed — without touching the content of <pre>, <textarea>, <script>, or <style>.
ツール要約
このツールは構造化された入力を受け取り、サーバーへアップロードせずにブラウザで決定的な出力を返します。
- ツール名
- HTML Minifier
- 入力の目的
- 変換・検証・分析するソースコンテンツを入力してください。
- 出力の目的
- コピー・再利用・デバッグに適した正規化された出力を受け取ります。
- 入力例
- <!DOCTYPE html> <html> <!-- a comment --> <body> <p> hello </p> </body> </html>
- 出力例
- <!DOCTYPE html><html><body><p> hello </p></body></html>
<pre>, <textarea>, <script>, and <style> is preserved verbatim.ツールの紹介
Shrink HTML to its smallest safe form: comments stripped, whitespace collapsed, and blank lines removed — without touching the content of <pre>, <textarea>, <script>, or <style>.
ツール概要
A minifier reduces the bytes a browser has to download by removing characters that do not affect rendering. Comments, runs of whitespace, and newlines between tags are all safe to strip in most documents. This tool walks your HTML, sets aside the contents of preserved tags (<pre>, <textarea>, <script>, <style>) so they survive intact, then collapses whitespace in the rest. Toggle each option to match your stack — keep IE conditional comments, preserve line breaks for readable diffs, or drop empty class="" attributes. Everything runs locally in your browser; nothing is uploaded.
ユースケース
- Trim bytes off email templates, transactional HTML, and AMP fragments before sending.
- Pre-process server-rendered HTML for cache-friendly delivery on edge networks.
- Strip developer comments and indentation from snippets before pasting into a CMS.
入力/出力の例
<!DOCTYPE html>
<html>
<!-- a comment -->
<body>
<p> hello </p>
</body>
</html><!DOCTYPE html><html><body><p> hello </p></body></html>
よくある質問
Will it break <pre> or <script> contents?+
Does it remove IE conditional comments?+
Is the output safe to deploy to production?+
Is my HTML uploaded?+
他のツールを見る
下記の Developer カテゴリで関連ユーティリティを探す。
関連ツール
役に立ちそうな厳選ユーティリティ