CSS Minifier
Minify CSS by stripping comments and whitespace safely. Runs in your browser with no upload, and reports the byte saving before and after gzip.
Need this built for your product?
We design, build & host secure software & APIs.
What minification actually removes
Minifying CSS strips the bytes a browser does not need: comments, indentation, newlines, the space after a colon, and the final semicolon in a block. None of it changes how the stylesheet behaves. For hand-written CSS the saving is typically 15 to 30 percent of the raw file.
Minification and compression are not the same thing
This is the part most people get wrong. Gzip and Brotli already collapse repeated whitespace very effectively, so the additional saving from minification after compression is much smaller than the raw numbers suggest, often only a few percent. Minification is still worth doing, because it reduces parse time as well as transfer size, but the honest framing is that compression does most of the work. If your server is not compressing CSS at all, fixing that matters far more than minifying.
What must not be removed
Whitespace is significant in several places and a naive minifier breaks them. Inside calc() the spaces around + and - are required by the grammar: calc(100%-20px) is invalid, while calc(100% - 20px) is correct. Descendant combinators are spaces, so removing the space in .a .b turns it into a completely different selector. Spaces inside quoted strings, attribute selectors and content values are literal. Comments beginning /*! are conventionally preserved because they carry licence text.
Order is not safe to change
Minifiers that merge duplicate selectors or reorder declarations can silently change specificity outcomes and cascade behaviour, particularly with vendor prefixes or intentional overrides. This tool restricts itself to removing insignificant characters and does not reorder or merge rules, which makes the transformation predictable.
Keep a source map or the original
Minified CSS is effectively unreadable and undebuggable. Always keep the unminified source in version control and minify as a build step rather than editing the minified file. Generating a source map lets browser developer tools point at the original line numbers.
Frequently Asked Questions
Privacy & Security
Processing is client-side.
How to Use
Paste CSS code and click Minify to reduce its size.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
JSON Formatter
DeveloperFormat and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
JSON Validator
DeveloperValidate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
Regex Tester
DeveloperTest regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.