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 code online to reduce file size. Removes comments, collapses whitespace, optimizes values, and shortens hex colors.

CSS Minifier

The CSS Minifier is a free online tool that compresses stylesheets to reduce file size. It strips comments, collapses whitespace, removes trailing semicolons, optimizes zero values, and shortens hex colors — turning bloated development CSS into lean, production-ready code that downloads and parses faster.

Runs entirely in your browser. Your CSS is never uploaded or stored on a server — minification happens locally, so even proprietary stylesheets stay private.

Why Minify CSS

Faster Page Loads

Smaller stylesheets transfer in fewer bytes, improving First Contentful Paint and Core Web Vitals scores.

Lower Bandwidth

Cut 30–60% off file size to reduce hosting and CDN costs, especially on high-traffic sites.

Production Ready

Ship clean, compact CSS without setting up a build pipeline or installing any tooling.

How to Minify CSS

1

Paste or Upload Your CSS

Type or paste your stylesheet into the input panel on the left, or use Upload to load a .css file directly. Try the Sample button to see how it works.

2

Set the Comment Option

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

3

Minify

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

4

Review & Export

Check the stats bar for original size, minified size, and savings. Then Copy the result to your clipboard or Download it as a file.

Shortcut: press Ctrl + Enter in the editor to minify without reaching for the mouse.

Optimizations & Features

What Gets Optimized

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 valuespadding: 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. The minifier protects them so your math keeps working.

Comment Toggle

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

Compression Stats

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

Upload or Paste

Load a .css file from disk or paste code directly — whichever fits your workflow.

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

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.

Will minification break my CSS?

No. The minifier only removes unnecessary characters — whitespace, comments, redundant semicolons — and safely shortens values. It protects calc() expressions and leaves media queries and selectors untouched, so the rendered result is identical.

How much file size reduction can I expect?

Typical stylesheets shrink by 30–60%, depending on how many comments and how much whitespace the original contains. Heavily documented or generously formatted CSS sees the largest savings.

Should I keep an unminified version?

Yes. Minified CSS is hard to read and edit, so always keep your original, formatted source for development. Minify only the copy you deploy to production.

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.

Input
Output
Error

Paste code on the left to minify automatically

Original 0 B Minified 0 B
Saved 0%
|
Paste your CSS code and click Minify to compress it.
Use Ctrl+Enter to minify quickly.
Toggle Remove comments to keep or strip CSS comments.
Want to learn more? Read documentation →
1/4
Can't find it? Build your own tool with AI
Start typing to search...
Searching...
No results found
Try searching with different keywords