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
| Before | After |
|---|---|
color: #ffffff; | color:#fff |
margin: 0px; | margin:0 |
/* Buttons */ | removed |
.a { color: red } .b { color: red } | .a,.b{color:red} |
Related tools
CSS formatter, JavaScript minifier, and image compressor for even bigger page-speed wins.
How to use the CSS Minifier
- Paste your code into the input box, upload a file, or click Sample to try it out.
- Choose the options you want, such as indentation, line width or dialect.
- The result appears instantly in the output panel. Syntax errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.