Remove whitespace, comments and redundant markup, and see exactly how many bytes you saved.
2.2 KB minified to 1.4 KB · 4 comments removed
35% smaller (788 B saved)
How It Works
Drop the page into the left pane or open an .html file from your computer. The minified version appears on the right as you type.
The strip above the panes shows original size, minified size and the percentage saved. Turn on Aggressive for a smaller file, or turn off inline CSS/JS minifying if you want those blocks left exactly as they are.
Copy the minified HTML, download it as index.min.html, or publish it straight to a free live link without creating an account.
About This Tool
A conservative HTML minifier that runs entirely in your browser and shows you exactly what it saved.
This HTML minifier takes a page and removes the parts a browser never shows: indentation, blank lines, runs of spaces between tags, and ordinary comments. What comes out is the same page with fewer bytes, ready to copy, download or publish. The savings strip tells you the original size, the minified size and the percentage saved, so you can decide whether the smaller file is worth having.
Most people arriving here are holding a finished HTML file from somewhere else: a page ChatGPT or Claude wrote, an export from a design tool, a template from a course, a landing page a freelancer handed over. Those files are usually well indented and full of explanatory comments, which is great for reading and pointless for serving. If you want to compress HTML before you put it online, or you simply want to see how much of your file is whitespace, paste it in.
The minifier is a small scanner written for this page, not a heavyweight library. It walks your HTML once and treats four elements as untouchable: <pre>, <textarea>, <script> and <style>. Their contents are copied byte for byte, because whitespace in a <pre> is the whole point and JavaScript is not something you want a regex rewriting. Everywhere else, runs of whitespace collapse to a single space, comments disappear (conditional <!--[if comments and licence comments starting <!--! stay), and whitespace inside tags is tidied without touching quoted attribute values.
Two options change the behaviour. Minify Inline CSS/JS (on by default) strips CSS comments and collapses whitespace inside <style>, and inside <script> it only removes whole-line // comments and indentation; a script that contains a template literal is left alone entirely. Aggressive (off by default) removes whitespace next to block-level tags completely instead of leaving one space, which saves a little more but can close the gap between inline-block elements such as a row of buttons. Everything runs in your browser; nothing is uploaded until you choose to publish.
This is an HTML compressor that prefers safe over small. It does not remove optional quotes around attributes, drop optional closing tags, or rename anything. If you need the last few percent, a build-step minifier will do more. If you need the opposite, the HTML Formatter turns minified markup back into something readable, and the HTML Viewer shows the minified page rendered so you can check nothing shifted.
Once the file is as small as you want it, the Publish button puts it on a free OxyPages link with HTTPS in a few seconds, no account needed. The link lasts 30 minutes unless you claim it, and claiming is free; from there you can choose your own address and, on a paid plan, connect a custom domain. See how it works for the full picture.
Questions
More Free Tools
Every tool here runs in your browser and ends the same way: one click and your HTML is on a live link.
Clean up messy or minified HTML with proper indentation in one click. Runs in your browser, nothing is uploaded. Publish the result as a live page.
Paste or drop an HTML file and see it rendered instantly. Preview on desktop and mobile, then publish it as a live website in one click.
Write or paste HTML, CSS and JavaScript and run it in the browser. Live preview, console output, then host the result for free.
Try It Now
Still Here? Drop It In.
The whole pitch fits in one sentence: your HTML, on a link, in seconds.
Drag and drop your HTML file(s), folders, or ZIP file
or ·
No account needed. Your unclaimed website stays live for 30 minutes on a free subdomain. Claim it to your account to keep it permanently.