HTML Minifier
Minify HTML to shrink page weight: comments are stripped and whitespace between tags is collapsed, while the contents of <pre>, <textarea>, <script> and <style> are left untouched. It all runs in your browser.
78 → 50 bytes · 36% smaller
How to use it
- 1Paste HTML
Paste your HTML markup into the input box.
- 2See the minified output
Comments and extra whitespace are removed live, and the size saved is shown.
- 3Copy
Copy the minified HTML with one click.
Safe, conservative minification
Smaller HTML means fewer bytes to download and faster first paint. This minifier removes comments and redundant whitespace — the low-risk wins — without rewriting your markup or attributes.
Whitespace-sensitive regions are protected: anything inside <pre>, <textarea>, <script> or <style> is preserved exactly, so formatted code blocks and inline scripts keep working.
Frequently asked questions
Does it touch my scripts or styles?
No. The contents of <pre>, <textarea>, <script> and <style> are preserved exactly — only whitespace between tags and comments are removed.
Is my HTML uploaded anywhere?
No. Minification runs entirely in your browser; your markup never leaves your device.
Are conditional comments kept?
Yes. Internet Explorer conditional comments (<!--[if ...]>) are preserved; ordinary comments are removed.
Related tools
CSS Minifier
Minify CSS to shrink stylesheet size: remove whitespace, comments and redundant values. Runs entirely in your browser — nothing is uploaded.
JavaScript Minifier
Minify JavaScript with Terser: rename locals, drop whitespace and fold constants to shrink your code. Runs entirely in your browser — nothing is uploaded.
XML Formatter
Format and indent messy XML in your browser. Paste XML and get clean, readable output. No upload, no sign-up — your data never leaves your device.