iLoveMyFile

HTML Minifier

Shrink HTML by removing comments and extra whitespace, and minifying the CSS and JavaScript inside it.

Input

Paste HTML above, or upload an .html file.

How to use HTML Minifier

  1. Paste your HTML or upload a file.
  2. Click Minify HTML.
  3. Copy the result or download it, and keep your original as the version you edit.

Frequently asked questions

Will minifying break my page?

It should not. Whitespace between tags is reduced to a single space rather than removed, which keeps words and inline elements spaced as before. Content inside <pre> and <textarea> is left untouched.

What exactly is removed?

HTML comments, extra spaces and line breaks, and the same inside any CSS and JavaScript in the page.

How much smaller will it be?

Typically 10–30% for hand-written HTML. The exact saving is shown after you minify.

Is my text uploaded to a server?

No. This tool runs entirely in your browser, so what you paste never leaves your device.