Web Tools · Free · No signup
Paste any HTML document and get a lighter version in one click: comments go away and whitespace between tags collapses, while your <pre>, <textarea>, <script> and <style> blocks are protected exactly as they are. Byte-accurate savings are shown after every run — and the whole job happens locally in your browser.
🔒 100% private: everything runs inside your browser — nothing is uploaded, stored or logged.
<pre>, <textarea>, <script> and <style> are lifted out before minification and put back byte-for-byte — indentation inside them survives.
Downlevel-revealed and <!--[if …]<![endif]--> conditional comments are never touched — legacy Outlook and IE hooks keep working.
Savings are measured in real bytes (UTF-8), not characters — you see exactly what the server will save.
Copy the minified markup or download it as a file, ready to drop into your build output.
The minifier is plain JavaScript running in your browser. Nothing is uploaded, stored or logged.
Input & output. Any HTML fragment or full document works — templates, email HTML, inline SVG containers, static site output. Output is a single line of collapsed markup ready for production; run it through your own formatter if you need to read it again later.
This is a text-level minifier, not an HTML parser: it never removes attributes, rewrites tags or reorders elements, and it does not validate markup. Collapsing whitespace merges runs of spaces in visible text down to one space — deliberate double-spacing in copy disappears. Whitespace inside pre, textarea, script and style blocks is left completely untouched.
Yes. Those blocks are extracted before minification and restored byte-for-byte afterwards, so code samples and form values keep their exact spacing.
No. Script and style elements are protected from the whitespace collapsing. Note that this tool does not minify their contents — run the CSS Minifier or JS Minifier for that.
No. <!--[if …]<![endif]--> conditional comments are intentionally preserved; every other comment is removed.
Typical hand-written or CMS output shrinks by 5–20%, mostly from indentation and comments. Already-minified HTML may barely change.
No. Everything runs locally in your browser — you could disconnect from the internet and the tool would still work.
Keep going
Minify stylesheets online — comments, whitespace and zero-values trimmed.
Use Tool →
Minify JavaScript safely — comments out, strings, regex and ASI preserved.
Use Tool →
Minify SVG files to shrink their size without losing quality.
Use Tool →
Format, validate and minify JSON with clear error locations.
Use Tool →
Generate SEO and Open Graph meta tags with a search preview.
Use Tool →
On mobile?
This tool runs in any mobile browser — no app needed. And for the image & PDF side of the toolbox, the CompressoPanda Android app ships 36 tools that run with no connection at all: compression to target size, editing and PDF essentials included.