How to use it
- Paste your CSS, or open a .css file.
- Leave Language on CSS and the action on Minify (preselected here).
- Read any warnings below the output.
- Copy the result or download minified.min.css.
Worked example
.card{padding:16px 16px 16px 16px;color:#ff0000;margin:0px} followed by a comment and .card h2{margin:0px} (91 bytes) minifies to .card{padding:16px;color:red}.card,.card h2{margin:0}, which is 53 bytes.
Formats and limits
| Input | CSS |
|---|---|
| Output | Minified CSS |
| Engine | Prettier standalone; Terser; CSSO; HTML whitespace/comment minifier with embedded CSS/JS minification |
Limitations
- Rule merging can move declarations between rules; test the result before deploying.
- Sass, Less and other preprocessor syntax is not compiled; minify the compiled CSS.
- Parts with syntax errors are dropped from the output and listed as warnings.
Questions
What does the minifier change?
CSSO removes whitespace and comments, shortens values such as #ff0000 to red and 0px to 0, merges padding written four times into one value, and joins rules that share the same declarations.
Are license comments kept?
Yes. Comments that start with /*! are kept; all other comments are removed.
What happens with a CSS error?
The minified CSS is still produced, and up to five warnings name the line and column of the parts that could not be read. Browsers skip those parts, and so does the minified output.
Is my CSS uploaded?
No. The code is processed in your browser and nothing is uploaded.
Privacy
Runs on your device. Files and text are processed in this browser tab and are not uploaded.
This page opens the Code formatter and minifier ready for this task. See the privacy policy for how toolsdocks handles data.