# CSS Minifier

> Shrink CSS by stripping comments, collapsing whitespace, and tightening punctuation. See byte savings live.

URL: https://uttir.com/css-minifier
Categories: developer-tools, web-tools
Privacy: CSS never leaves your browser.

## About

CSS minification removes comments, collapses whitespace, drops the last semicolon in a rule, and tightens the spaces around punctuation. The result is a CSS file that is functionally identical to the source but typically 20-40% smaller.

Use this when you have a hand-written stylesheet and want a quick minified copy without setting up a build pipeline. For production projects, run your CSS through a proper tool (cssnano, lightningcss) as part of your build.

## How to use

1. **Paste your CSS** — A snippet, a file, or an entire stylesheet.
2. **Read the result** — The minified CSS appears instantly.
3. **Copy** — One click to put the minified CSS on your clipboard.

## Examples

### Comment stripping

A simple comment-and-whitespace example.

Input:

```
/* header */ .a { color: red; }
```

Output:

```
.a{color:red}
```

### Punctuation tightening

Spaces around { } ; : , are removed.

Input:

```
a , b > c { color : red ; }
```

Output:

```
a,b>c{color:red}
```

## FAQ

### Does it preserve source maps?

No. This is a copy-paste minifier. If you need source maps for debugging, use a build-time tool like cssnano or lightningcss with the sourceMap option enabled.

### Are there any CSS features it does not support?

It works on any valid CSS. The minifier is purely syntactic — it does not parse or transform selectors, so anything your browser accepts is fair game.

### Will minification break my CSS?

No — the minifier only removes whitespace, comments, and trailing semicolons. The browser reads the minified CSS identically. Always test the minified output, but for well-formed CSS, it is safe.

## Related tools

- [HTML Minifier](https://uttir.com/html-minifier) — Shrink HTML by stripping comments and collapsing whitespace. See byte savings in real time.
- [JavaScript Minifier](https://uttir.com/js-minifier) — Quick JS minifier that strips comments and collapses whitespace. Best for trusted, simple code snippets.
- [JSON Formatter](https://uttir.com/json-formatter) — Format, beautify, and validate JSON with adjustable indentation — instantly in your browser.

---

For the full HTML page with the live tool, visit https://uttir.com/css-minifier.
This file is the markdown rendering at https://uttir.com/css-minifier.md. See https://uttir.com/llms.txt for a site-wide summary.
