Your files stay on your device

# CSS formatter

Pretty-print or minify CSS in the browser: paste CSS, pick two spaces, four spaces, or tabs, and get it back formatted or on one line.
CSS input

Paste some CSS to format or minify it.

This is a structural formatter, not a linter or an optimizer. It will not fix invalid CSS, add missing semicolons to a broken rule, autoprefix, reorder properties, or drop comments; the minify mode in particular keeps comments on purpose, because deleted comments do not come back. Its whitespace dropping is deliberately conservative: spaces survive where removing them could change what a selector matches, such as the descendant space in `div :hover`. Unbalanced braces and unterminated strings or comments are reported with the line they start on, not guessed around.
Options

## More regex & cron tools

- [JSON formatter](/json/formatter)
- [JSON string escape](/json/escape)
[All regex & cron tools](/dev)

Was this tool useful?
YesNo

---

Canonical HTML: https://nutter.tools/dev/css-formatter
Markdown version: https://nutter.tools/dev/css-formatter.md
Plain-text version: https://nutter.tools/dev/css-formatter.txt
Agent index: https://nutter.tools/llms.txt

