# CSS Formatter

> Beautify or minify CSS, including media queries. Runs entirely in your browser — nothing is uploaded.

Source: https://toffeekit.com/tools/css-formatter

**Category:** [Developer](https://toffeekit.com/category/developer) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/css-formatter

**Also useful for:** css, beautify, minify, prettify, format, stylesheet, indent

## How it works

1. Paste your CSS into the CSS box, or click Sample.
2. Pick Beautify to expand it or Minify to compress it.
3. When beautifying, choose an indent of 2 spaces, 4 spaces or Tab, and One selector per line.
4. Click Copy or Save to download styles.css or styles.min.css.

## FAQ

### How do I beautify minified CSS?

Paste the minified code with Mode on Beautify. Each rule, declaration and nested at-rule is put on its own line and indented.

### How do I minify CSS?

Switch Mode to Minify. Whitespace and comments are removed and the output is saved as styles.min.css.

### Does it handle media queries and keyframes?

Yes. Contents of @media, @supports and @keyframes are indented correctly.

### Will minifying break my CSS?

It should not. Only whitespace and comments are removed, and values like url(data:...) and quoted strings are left alone.

### How do I keep a licence comment when minifying?

Leave Keep /*! licence */ comments on. Comments that start with /*! are retained, and other comments are removed.

### Is CSS Formatter free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

## Privacy

CSS Formatter runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [JSON Formatter](https://toffeekit.com/tools/json-formatter) — Format, minify and validate JSON with clear errors.
- [Base64 Encode / Decode](https://toffeekit.com/tools/base64-encoder) — Encode text to Base64 or decode it back, UTF-8 safe.
- [URL Encode / Decode](https://toffeekit.com/tools/url-encoder) — Percent-encode query values or whole URLs.
- [HTML Entities](https://toffeekit.com/tools/html-entity-encoder) — Escape < > & and quotes, or decode entities.
- [JWT Decoder](https://toffeekit.com/tools/jwt-decoder) — Read a token's header, claims and expiry.
- [Hash Generator](https://toffeekit.com/tools/hash-generator) — MD5, SHA-1, SHA-256, SHA-384 and SHA-512 at once.

