Minify CSS with CSSO, which does rather more than strip whitespace: it shortens colours, collapses shorthand properties and, if you let it, merges rules that share declarations.
Restructuring is where the real difference comes from, and it is also what deserves a second look: it changes the order of rules, and in stylesheets with a lot of crossing specificity that can change the outcome.
How to use it
- Paste the CSS.
- Decide whether to enable restructuring.
- Copy or download the .min.css.
Frequently asked questions
- Is restructuring safe to enable?
- It is in the vast majority of stylesheets, but check the page afterwards. If you have rules that depend on source order to beat each other, better to leave it off.
- What are /*! */ comments?
- The convention for a comment that must not be removed, such as a licence header. With the box ticked they survive and the rest go.
- How much is usually saved?
- Between 15 and 30 % on a hand-written stylesheet. If the server already gzips or brotlis, the end gain is more modest, but still real.
Related tools
Minify JavaScriptTerser in the browser, with optional name mangling.
Count words and charactersA live count, reading time and the limits each platform imposes.
Change letter caseUPPERCASE, lowercase, Title Case, camelCase, snake_case and more.
Sort and clean up linesSort, drop duplicates and blanks, number or reverse a list.
URL encode and decodePercent-encoding, for whole addresses or for a single parameter.