HTML & CSS Minifier

Shrink HTML and CSS by removing whitespace and comments.

Remove comments and whitespace from HTML and CSS to make pages lighter.

🔒 Your code stays in your browser.

How to use the html & css minifier

  1. Choose HTML or CSS.
  2. Paste your code.
  3. Click Minify and copy the result.

Safe minification

Content inside pre, textarea and script tags is left untouched so it keeps working. Inline style blocks are minified as CSS.

Frequently asked questions

Will minifying break my site?

Basic whitespace and comment removal is safe for valid HTML/CSS. Keep the original for editing.

Does it minify JavaScript?

No – use a build tool like esbuild or Terser for JS.

How much smaller?

Typically 10-30%.

Guides

Related free tools

See all 147 free tools →