# Minify CSS source code

> Remove comments and extra whitespace from CSS while preserving selectors and declarations.

Canonical: https://staticx.site/css-minifier

## Compact CSS safely

Remove comments and extra whitespace from CSS while preserving selectors and declarations.

## Good for small assets

Use it for hand-written CSS files, snippets, or copied styles that do not need a full build tool.

## Review before replacing

Keep a readable source file when future editing matters.

## How to use CSS Minifier

Compress small CSS assets after review while keeping readable source available elsewhere.

1. **Paste CSS** — Add the stylesheet or snippet you want to compact.
2. **Minify CSS** — StaticX removes comments and unnecessary whitespace.
3. **Preview the page** — Use the result in context and verify selectors still apply correctly.

## CSS minification should support, not replace, a clean stylesheet.

Minified CSS can reduce file size, but it also makes manual editing harder. It works best after the readable stylesheet has already been reviewed.

For large framework builds, rely on the build pipeline. Use this utility for smaller static pages and snippets.

## CSS minification notes

- **Removes comments** — Helpful before publishing copied or annotated styles.
- **Does not autoprefix** — Use a build tool if you need browser prefixing or advanced CSS transforms.
- **Watch source maps** — This utility does not create source maps. Keep readable source separately.

## FAQ

### Does CSS minification change design?

It should not, but always preview the page because invalid CSS can behave unexpectedly.

### Will this add vendor prefixes?

No. It only minifies. Use PostCSS or a framework build for prefixing.

### Should I minify CSS for every site?

Not always. For small sites, clarity may matter more than a tiny size reduction.

[View on staticx.site](https://staticx.site/css-minifier)
