Home / Tools / CSS minifier

CSS Minifier: Compress CSS and Reduce File Size Online

Remove comments and extra spaces from CSS, shorten colors and zero values, and drop empty rules. See how many bytes you save. Runs in your browser.

Paste your CSS and press Minify. Comments and extra spaces are removed, the last semicolon in each rule is dropped, and with Shorten colors, zeros and drop empty rules on, values such as #ffffff, 0px and 0.50em become #fff, 0 and .5em. The page shows the size before and after.

What it does

Shortening skips values inside calc(), min(), max(), clamp() and custom properties, where a unitless zero would be wrong. It does not merge rules or remove unused CSS.

Example

Before

/* header */
body{margin:0;font-family:Arial,sans-serif}
.nav a:hover,.nav a:focus{color:#fff;background:#0a58ca}
@media (max-width:600px){.nav{display:none}}

After

body{margin:0;font-family:Arial,sans-serif}.nav a:hover,.nav a:focus{color:#fff;background:#0a58ca}@media (max-width:600px){.nav{display:none}}

Frequently asked questions

Is the minified CSS safe to use?
It only removes characters that CSS ignores and shortens values that mean the same thing. Strings, url() values, custom properties and math functions are kept as they are. Untick the shorten option if you want whitespace removal only.
How much smaller will it get?
Usually 10 to 30 percent for hand-written CSS, more if it has many comments. The page shows the exact saving.
Does it rename classes or merge rules?
No. It does not rewrite your selectors or merge rules, so the result is safe but not as small as an optimiser that does.
Should I also use gzip?
Yes. Servers can compress minified CSS further with gzip or Brotli. The two savings add up.

Runs in your browser. Nothing you type is sent to this site. Updated 2026-10-11.

More tools

Code formatters

CSS beautifier HTML beautifier HTML minifier JavaScript beautifier JavaScript minifier JSON formatter YAML formatter XML formatter SQL formatter Markdown preview

Converters

Base64 encoder and decoder URL encoder and decoder Unix timestamp converter CSV to JSON JSON to CSV HTML entity encoder and decoder Number base converter Time zone converter JSON to TypeScript XML to JSON HTML to Markdown Date difference calculator

Text tools

Regex tester Remove duplicate lines Lorem ipsum generator Word counter Case converter Text diff checker

Color and images

Color converter Contrast checker Image to Base64 Image resizer

Network

Subnet calculator Download time calculator Common ports list CIDR to IP range IPv6 address expander and compressor MAC address formatter curl command builder

Server and files

Cron expression explainer chmod calculator HTTP status codes

Encoding and security

Password generator UUID generator Hash generator JWT decoder QR code generator Password strength checker Wi-Fi QR code generator