Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
CSS Minifier

CSS Minifier

Minify CSS in your browser to shrink stylesheet size. Strips comments, collapses whitespace, shortens hex colors and zero units, with live size stats.

Compress CSS Stylesheets in Your Browser

This CSS minifier shrinks stylesheets by stripping every byte the browser does not need to render your page. It removes comments, collapses whitespace, drops trailing semicolons, shortens zero units and hex colors — turning bloated development CSS into lean, production-ready code that downloads and parses faster.

Private by design: your CSS is minified entirely in your browser and never uploaded or stored on a server — even proprietary stylesheets stay on your machine.

Why Minify CSS

Faster Page Loads

Smaller stylesheets transfer in fewer bytes, improving First Contentful Paint and Core Web Vitals since CSS is render-blocking.

Lower Bandwidth

Cut roughly 20–50% off file size to reduce hosting and CDN transfer, especially on high-traffic sites.

No Build Step

Ship clean, compact CSS without installing tooling or wiring up a build pipeline — paste, minify, copy.

How to Minify CSS Code

1

Paste or Upload Your CSS

Type or paste your stylesheet into the input panel, or use Upload to load a .css file. Try the Sample button to see it in action. Minification also runs automatically as you type.

2

Set the Comment Option

Toggle Remove comments on to strip every /* ... */ block, or off to keep license headers and notes.

3

Minify

Click Minify or press Ctrl + Enter. The compressed CSS appears instantly with syntax highlighting in the output panel.

4

Review & Export

Check the stats bar for original size, minified size, and percent saved. Then Copy the result or Download it as minified.css.

Shortcut: press Ctrl + Enter in the editor to minify immediately, or just keep typing — it auto-minifies after a short pause.

What the CSS Compressor Optimizes

The minifier applies safe, well-established transformations that shrink your CSS without changing how it renders.

OptimizationBeforeAfter
Strip comments/* header */(removed)
Collapse whitespacemargin: 0 auto;margin:0 auto
Trailing semicolonscolor:red;}color:red}
Zero unitspadding: 0px;padding:0
Shorten hex colors#ffffff#fff

Built to Stay Valid

Preserves calc() Expressions

Spaces around operators inside calc() are required by the spec, so the minifier protects them and your math keeps working.

Comment Toggle

Keep or strip /* */ comments with a single switch — handy for retaining license banners.

Live Compression Stats

See original size, minified size, and the percentage saved after every run.

Upload, Copy & Download

Load a .css file from disk, copy the result to your clipboard, or download it as a file.

Good to know: minification changes only formatting, not selectors or rules. It does not merge duplicate rules or rewrite shorthand, so the cascade behaves exactly as before.

Frequently Asked Questions

What does minifying CSS actually do?

It removes characters the browser doesn't need to render the page — line breaks, indentation, comments, and spaces around braces, semicolons and colons — plus safe shortcuts like 0px → 0 and #ffffff → #fff. Selectors, properties, values and cascade order are preserved exactly.

How much smaller will my CSS get?

Most stylesheets shrink by about 20–50%, depending on how many comments and how much whitespace the original contains. Heavily documented or generously formatted CSS sees the largest savings. The stats bar shows the exact percentage for your file.

Will minification break my stylesheet?

No. The minifier only removes unnecessary characters and safely shortens values. It protects calc() expressions and leaves media queries and selectors untouched, so the rendered result is identical to your source.

Can I unminify or format minified CSS again?

This tool only minifies. Because minification is a formatting change, a code beautifier can re-indent the output, but original comments and naming are gone. Always keep your unminified source for development and minify only the copy you deploy.

Is minifying the same as gzip compression?

No — they stack. Minification rewrites the CSS to remove redundant characters; gzip or Brotli then compresses the transferred bytes at the server level. Minify first, then let your server apply gzip on top for the smallest download.

Does it remove license comments?

If Remove comments is on, all /* */ comments are stripped, including license headers. Turn the option off when you need to preserve attribution or legal notices.

Is my code sent to a server?

No. All minification happens locally in your browser using JavaScript. Your CSS is never uploaded, logged, or stored anywhere.

Input
Output
Error

Paste code on the left to minify automatically

Original 0 B Minified 0 B
Saved 0%
|
Paste or upload your CSS, then click Minify or press Ctrl+Enter.
Toggle Remove comments off to keep license headers and notes.
calc() spacing is preserved so your math keeps working.
Want to learn more? Read documentation →
1/4
Start typing to search...
Searching...
No results found
Try searching with different keywords