CSS Minifier

CSS Minifier removes comments, collapses unnecessary whitespace, and applies selected safe text reductions to submitted CSS. It does not remove unused selectors or replace HTTP compression, so test the result on the target pages.

Supported: .css, .txt

Preparing your result

What this tool does

CSS Minifier

Your input is sent to the server for this request and is not saved as a tool content record. Infrastructure logs may still record request metadata, so do not submit secrets.

Use this page when the task is direct action. The interface is visible immediately, the workflow is clear, and related internal links keep adjacent tasks close.

Need to optimize a full project?

Process a complete static website ZIP

Use the free single-file minifier here, or scan a full website archive with Website ZIP Optimizer. Eligible ZIPs can optimize up to 75 HTML, CSS, and JavaScript files for a one-time $5 USD payment.

Check website ZIP eligibility

How to use this tool

How to minify CSS

01

Paste CSS or upload one CSS or text file up to 1 MB.

02

Choose comment, whitespace, zero-value, color, and aggressive cleanup options.

03

Select Minify CSS and compare the output with the tested example.

04

Test important pages and states before deploying the generated file.

Before and after example

CSS minification example

Input

.button {
  padding: 12px 16px;
  color: #ffffff;
}

Output

.button{padding:12px 16px;color:#fff}

Options, errors, and limitations

CSS options, limitations, and output testing

Parent category

Explore the Minify Tools hub

Pages focused on CSS, HTML, JavaScript, and JSON minification workflows.

Related articles

Read more from the developer blog

FAQ

CSS Minifier FAQ

How can smaller CSS reduce transferred bytes?

Minification removes source characters before the stylesheet is sent. Fewer source bytes can reduce the uncompressed resource size, while the actual network transfer also depends on caching and HTTP compression.

Does CSS Minifier remove unused CSS?

No. It transforms the submitted stylesheet without knowing which selectors a site uses. Use browser coverage data or a build tool to identify unused rules, then test every affected template and state before deleting them.

Is CSS minification the same as Brotli or gzip?

No. Minification rewrites the source into a smaller text representation. Brotli or gzip is applied by the server or CDN while transferring that representation; production sites commonly use both.

Which CSS options are available?

The interface can remove comments and whitespace, shorten supported zero units and six-digit hex colors, and apply an aggressive cleanup mode. The service also removes safe final semicolons when that form option is submitted.

Does the tool preserve license comments?

No special license-comment exception is implemented. If Remove comments is selected, CSS block comments are removed, so preserve required notices separately or leave that option off.

Can aggressive mode change CSS behavior?

It applies additional text substitutions and needs extra review. Test responsive breakpoints, custom properties, calc expressions, pseudo-classes, animations, and any legacy syntax used by the project.

Should I keep the readable stylesheet?

Yes. Keep reviewed source in version control and generate minified output as a deployment artifact so debugging, code review, and rollback remain practical.

Can the tool prove a page will load faster?

No. It reports byte differences for the submitted text. Real loading depends on the stylesheet size, cache state, compression, latency, render blocking, unused rules, and the rest of the page.