CSS Minifier
Make stylesheets load faster. Spacing and comments are removed, values are written in their shortest form, and duplicate rules are merged, without changing how anything looks.
How to minify CSS
- 1Paste your CSS or open a .css file.
- 2Choose whether to merge rules and keep license comments.
- 3Copy the minified CSS or download it.
Shorter values
Colors, zeros and units get their shortest form: #ffffff becomes #fff, 0px becomes 0, and margin: 0 0 0 0 becomes margin: 0.
Merged rules
With “Merge duplicate rules” on, rules with the same selector are combined and repeated declarations removed, which often saves more than removing whitespace alone. It's powered by CSSO.
License comments
Comments starting with /*! usually hold licenses and are kept unless you turn that off; all other comments are removed.
Frequently asked questions
- Is my code uploaded?
- No. Everything runs in your browser, so your code never leaves your device.
- How much smaller will it get?
- Typically 20–50%, depending on how much spacing, comments and repetition the stylesheet has. The saving is shown under the result.
- Can I get readable CSS back?
- Use CSS Formatter. Comments that were removed can't come back, so keep your original file.