HTML

HTML Minifier

Shrink HTML by collapsing whitespace and stripping optional comments — see the size savings instantly.

Minification runs locally in your browser. Nothing is uploaded, logged, or stored.

0 chars
1
Paste HTML here...
0 chars
Result appears here

How to use

  1. Paste your HTML into the input panel.
  2. Optionally enable comment removal, then click Minify.
  3. Compare the before/after sizes, then copy or download the result.

What is safe to remove?

Consecutive spaces, tabs, and line breaks between and inside tags are collapsed to single spaces (or removed entirely where they carry no visual effect). Comments are removed only when you opt in. Text inside <pre>, <script>, and <style> blocks is left untouched so formatting-sensitive content keeps working.

Need readable markup again? Run the output through the HTML Formatter. For XML documents, use the XML Minifier instead.

Examples

Speed up static pages

Minify hand-written HTML templates before deploying to shave kilobytes off every request.

Compact email templates

Reduce inline-styled email markup size before pasting it into a sending platform.

Frequently Asked Questions

Is my HTML uploaded anywhere?+
No. Minification happens entirely in your browser.
Will it break my page layout?+
Whitespace-sensitive blocks (pre, script, style) are preserved. In rare edge cases that rely on exact spacing in normal text, review the output before deploying.
Are comments removed?+
Only when you enable the Remove comments option — otherwise they are kept.
How much can I save?+
Indented, commented HTML typically shrinks 20–40%; the exact savings are shown next to the output.

Related Tools

Looking for something else? Browse all tools