+ +

Free tool · HTML compressor

Free HTML minifier

Paste HTML or drop an .html file to remove comments and the whitespace that never shows. See the bytes before and after and the percent saved. The page renders exactly as before.

+ +
Minified HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Proposal: Website refresh for Acme</title><style>body{font-family:system-ui,sans-serif;margin:0;color:#1c1917}header{padding:32px;background:#1c1917;color:#fff}.tag{display:inline-block;padding:2px 8px;border-radius:999px;background:#fff7ed}main{padding:32px}pre{background:#f5f5f4;padding:12px}</style></head><body><header><h1>Website refresh for Acme</h1><p>Northwind Studio for Acme Ltd <span class="tag">Draft</span> <span class="tag">v2</span></p></header><main><h2>Scope</h2><ul><li>New homepage and <strong>six</strong> landing pages</li><li>Design system in Figma</li></ul><h2>Timeline</h2><pre>Week 1   Discovery
Week 2   Design
Week 3   Build</pre><p style="margin-top:24px;color:#57534e">Questions? <a href="mailto:hello@northwind.example">Email us</a>.</p></main><script>
      // Mark the page ready once it has loaded.
      document.querySelector('h1').dataset.ready = '1';
    </script></body></html>
Inline JavaScript is left exactly as written.
Before 1,540 bytes · after 1,050 bytes · 490 bytes saved (31.8%) Runs in your browser. We don't store what you paste.
✓Your page live in seconds ✓An unlisted link you can send anyone ✓Claim it free to keep it live

Published free with no signup, the page is live for 7 days; sign up free to keep it. A published page is public to anyone with the link and noindex. Phishing and pages built to collect other people’s passwords or card details are taken down.

+ +

How it works

Minify HTML online in three steps

An HTML minifier makes a page smaller by removing what the browser never shows: comments, indentation, line breaks between blocks, and spare spaces in CSS. Paste HTML or drop a file into the minifier above and it is minified as you type, entirely in your browser, with nothing uploaded to a server.
1

Paste or drop HTML

Paste the code into the editor, or drop an .html file. Hand-written pages, AI exports and email templates all work.

2

Choose what to remove

Comments, whitespace that never shows, and spare spaces in CSS are on by default. Removing attribute quotes is off until you turn it on.

3

Copy, download, or publish

See the bytes before and after and the percent saved, then copy the minified HTML, download it as a .min.html file, or publish it as a link.

+ +

What it leaves alone

An HTML compressor that does not change the page

Whitespace in HTML is not always spare. A careless minifier joins two words, breaks a code sample, or changes a script. This one removes whitespace only where the browser ignores it.

Code and scripts stay exact

Text inside <pre>, <textarea> and <script> is copied byte for byte. JavaScript is left exactly as written, because rewriting it safely needs a full JavaScript parser.

Spaces between words stay

A space between two links or bold words is part of the text, and a missing one is too. Whitespace is removed only where the browser ignores it, next to blocks like div, p and li.

CSS keeps its meaning

In <style> and style="" only comments and spare spaces go. Strings, url() values and calc() spacing stay, and no rule is renamed, merged or reordered.

+ +

The next step

Compress HTML code, then send it as a link

A smaller page loads faster for the person you send it to. Publish it on its own URL, isolated from your account data, and free for 2 public pages, so you can see that it was opened.

Noindex by default

Published pages tell search engines to stay away, so a page you share won’t surface on Google the way most free hosts’ public pages can.

Password protection

On Solo and Team, lock confidential pages with an encrypted password we can’t read, enforced before the page ever loads.

View tracking

See when the page is opened. Solo and Team add unique viewers, country and time on page.

+ +

More free tools

Other viewers and converters

HTML formatter

Beautify HTML with a 2 or 4 space indent so you can read it again, with the size before and after.

Open the HTML formatter →

HTML viewer

Paste or upload a full HTML document and preview it instantly in a sandboxed frame, at desktop or phone width.

Open the HTML viewer →

HTML to text

Strip the tags from any HTML and keep the readable text, with lists, tables and line breaks intact.

Convert HTML to text →
+ +

HTML minifier FAQ

Paste the HTML or drop an .html file into the minifier above. It is minified as you type: comments and the whitespace that does not display are removed, and you see the bytes before and after and the percent saved. Copy the result or download it. It is free, needs no signup, and runs entirely in your browser.

+ +

Send the page, not the source

Free for 2 public pages. Solo is $15/mo and adds custom domains, passwords, and full view tracking.