Developer Tools

CSS Minifier

CSS contains strings, URLs, custom properties and expressions that make search-and-replace minification risky. This tool uses CSSO to parse and compact a stylesheet locally. Structural restructuring is disabled to keep optimizations conservative, while ordinary comments and unnecessary formatting are removed. Important comments beginning with an exclamation mark are retained. No stylesheet is inserted into the page, so pasted selectors cannot restyle the tool. Use small examples to inspect the result before applying it to a larger application.

Your workspace

Runs locally in your browser

Result

Your input is processed locally in your browser unless explicitly stated otherwise. Inputs are not saved by this tool.

How to use this tool

Paste CSS and select Minify. Review the compact output before copying it into your asset pipeline.

Example

Input

.card { color: red; padding: 0px; }

Output

.card{color:red;padding:0}

What does this tool do?

Minification reduces source characters; transfer compression such as Brotli or gzip reduces bytes sent over the network. They solve different problems and can be used together. A minifier may simplify zero units or color notation, but it cannot determine whether a selector is used by your application. Removing unused CSS requires knowledge of your markup and runtime states.

Common mistakes and limitations

Quoted content and data URLs require proper parsing. Do not remove every space with a regular expression: spaces can separate selectors and can be required inside calc expressions. CSSO is not a linter for every browser feature. Vendor extensions or recently introduced syntax may need review in your target browsers. Keep a development copy because compact output is harder to debug.

Frequently asked questions

Does it remove unused selectors?

No. It does not inspect your application or purge selectors.

Related tools