Skip to content
hateitall

CSS Minifier

Make a stylesheet smaller for production without breaking strings, url() values or calc() expressions.

Processed locallyIn: CSSOut: CSS

Loading tool…

How to use css minifier

  1. Paste CSS or open a .css file.

  2. Choose whether to keep /*! licence comments, drop empty rules and shorten colours and decimals.

  3. Check the size saving shown above the output.

  4. Copy the result or download it as .min.css.

What this tool does

  • Removes comments and every space the browser does not need, while keeping the spaces calc() and media queries require.
  • Shortens #aabbcc to #abc and 0.5 to .5 inside values only, never inside selectors or strings.
  • Drops the last semicolon in each block and, if you choose, rules that contain nothing.
  • Keeps licence comments that start with /*! so attribution survives.

How the result is verified

The minified CSS is parsed again and its rules and declarations are counted; the numbers must match your input, apart from any empty rules you chose to remove, before download is allowed.

Frequently asked questions

How much smaller will my CSS get?

Hand-written CSS usually shrinks by 15 to 35 percent. Files that are already compact gain less. Your web server's gzip or Brotli compression saves more again on top.

Is it safe to minify CSS with data URIs inside?

Yes. Unquoted url(...) values are read as a single unit, so semicolons and slashes inside a data URI are never touched.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Beautify minified CSS with clean indentation, selectors and media queries

CSS · Text→ CSSLight on device

Remove whitespace and comments from HTML, keep pre and scripts safe

HTML→ HTMLLight on device

Live CSS editor with HTML to style, presets and phone width preview

CSS · HTML→ PreviewLight on device

Compare two texts line by line with changed words highlighted

Text · Code→ DiffModerate on device