CSS Minifier

Minify CSS by removing comments, collapsing whitespace, shortening colors, and removing zero units.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

dropHint

What is CSS Minifier?

A tool that compresses CSS files to reduce their size. It uses a state-machine approach that correctly identifies string literals, url() values, and comments, so color codes inside strings are never accidentally transformed.

Six options can be toggled individually: comment removal, whitespace collapsing, last-semicolon removal, color shortening, zero-unit removal, and url() quote removal. Useful for improving page load speed and reducing HTTP response size.

How to Use

  1. Paste your CSS into the input field.
  2. Select the minification options (all enabled by default).
  3. Click "Minify" to get the compressed CSS.
  4. The reduction percentage and saved bytes are shown in the output header.
  5. Click "Copy Result" to copy to clipboard.

FAQ

Are important comments (/*! ... */) removed?

No. Comments starting with `/*!` are used for license notices and are always preserved, even when the remove-comments option is enabled.

How are color codes shortened?

'#rrggbb' values where each pair has identical characters are shortened to '#rgb' (e.g. #ffffff → #fff, #aabbcc → #abc). Common named colors such as white, black, and red are also converted to their shorter hex equivalents.

Is removing zero units safe?

Safe in most cases. Note that `0s` (used in transition-duration etc.) is also converted to `0`. Disable this option if you need compatibility with older browsers.

Is removing quotes inside url() safe?

Quotes are only removed when the URL contains no whitespace, parentheses, or other special characters. Data URIs are automatically preserved.

Is my data sent to a server?

No. All processing happens entirely in your browser.