Shrink CSS for production, or expand minified CSS to read it.
Minify reports how many bytes were removed when the pass shrinks the stylesheet.
▸ More about
Uses of CSS minification
- Shrinking a hand-written stylesheet before embed
- Expanding a minified vendor file to debug a rule
- Checking how many bytes comments cost
CSS minification pitfalls
- Expecting unused-rule elimination from a tokenizer
- Minifying the only copy of a stylesheet you still edit
CSS minification questions(8)
What does minifying CSS remove?
Comments and insignificant whitespace outside of strings and url() values. Selectors, property names, and values are not rewritten. Therefore calc(), custom properties and quoted content stay intact.
What can minifying not remove safely?
It does not drop unused rules, merge duplicates, or shorten colours. Those need a build pipeline that knows your HTML. A browser minifier that guessed would break pages.
What does beautify do?
Beautify expands minified CSS with two-space indentation and a line break after each semicolon and brace so you can read and edit it. It is the reverse layout pass of minify, not a linter.
Is my CSS sent to a server?
No. Tokenising, minifying and beautifying run in your browser. Nothing leaves this tab and nothing is stored remotely.
Will minify change how my page looks?
Not for ordinary stylesheets. Whitespace between tokens is insignificant in CSS. Keep a copy and compare after minifying if a stylesheet relies on a hack that needs a specific space inside a selector.
Does it handle @media and nested rules?
Yes at the token level: braces still open and close blocks. It does not understand CSS nesting semantics beyond brace matching, which is enough for minify and beautify.
Why show bytes saved?
So you can see whether a minify pass is worth shipping. A small file shrinks only a few bytes once gzip is applied; a large one drops kilobytes of comments and spaces.
When should I not minify?
When you still need to edit the file by hand, or when your deploy pipeline already minifies. Beautify first, edit, then minify as a last step before publish.