Skip to content
XUtilHub

CSS Minifier – Compress CSS Online

Minify CSS to make stylesheets smaller and faster to load. Removes whitespace and comments and merges rules safely with CSSO.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

About the CSS Minifier

Compress stylesheets for faster websites: whitespace and comments are removed, colors and values shortened, and duplicate rules merged, with the size saved shown.

Key features

  • Removes whitespace and comments
  • Shortens colors and values
  • Merges duplicate selectors and rules
  • Keeps /*! license */ comments if you want
  • Shows the bytes saved
  • Private: runs in your browser

Faster-loading stylesheets

CSS blocks page rendering: the browser waits for stylesheets before showing the page. Smaller CSS means a faster first paint. Paste a stylesheet to minify it and see the savings.

What gets optimized

BeforeAfter
color: #ffffff;color:#fff
margin: 0px;margin:0
/* Buttons */removed
.a { color: red } .b { color: red }.a,.b{color:red}

CSS formatter, JavaScript minifier, and image compressor for even bigger page-speed wins.

How to use the CSS Minifier

  1. Paste your code into the input box, upload a file, or click Sample to try it out.
  2. Choose the options you want, such as indentation, line width or dialect.
  3. The result appears instantly in the output panel. Syntax errors are shown with their line and column.
  4. Click Copy to copy the result, or Download to save it as a file.

Frequently asked questions

Will minified CSS look different on my site?

No. CSSO only makes changes that keep the same result, such as removing whitespace, shortening #ffffff to #fff and 0px to 0.

What does 'Merge & restructure rules' do?

It combines selectors with identical declarations and removes overridden properties, which can save more space. Turn it off if you want the rule order and structure left exactly as written.

How much smaller will my CSS get?

Usually 15–40%, more if the stylesheet has lots of comments and whitespace. Already-minified CSS won't shrink much.

How do I reverse minification?

Use the CSS Formatter to make minified CSS readable again. Removed comments can't be recovered.

Is my code uploaded anywhere?

No. Every developer tool runs entirely in your browser, so source code, configuration files and passwords never leave your device.

Which formatter do you use?

HTML, CSS and JavaScript are formatted with Prettier, the most widely used code formatter, so the output matches what most projects use. SQL uses sql-formatter, and minification uses Terser and CSSO.

Is there a size limit?

There's no fixed limit. Very large files (several megabytes) can take a few seconds, depending on your device.

Last updated:

Related Dev tools