OxyPages

Free Online HTML Minifier

Remove whitespace, comments and redundant markup, and see exactly how many bytes you saved.

Free. No account. Live in seconds.

2.2 KB minified to 1.4 KB · 4 comments removed

35% smaller (788 B saved)

Original HTML
Minified HTML
Free. No account. Live in seconds.

How It Works

How To Use The HTML Minifier

  1. 1

    Paste Or Open Your HTML

    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.

  2. 2

    Check The Savings

    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.

  3. 3

    Copy, Download Or Publish

    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

Minify HTML Without Breaking It

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.

Who It Is For

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.

How It Works

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.

Limits

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.

Then Put It Online

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

Frequently Asked Questions

Almost never with the default settings. Runs of whitespace become a single space, which is what the browser renders anyway, and the contents of pre, textarea, script and style are preserved exactly. The Aggressive option removes whitespace beside block-level tags entirely, which can close a visible gap between inline-block elements, so check the result in a viewer before relying on it.

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.

  • No Account Needed
  • Free SSL
  • 30-Minute Unclaimed Link, Claim To Keep It