CSS Formatter & Minifier

Actions & options

Conservative minifier: strips comments, redundant whitespace and trailing semicolons, while leaving selectors, values and function whitespace (calc(), etc.) untouched

What is CSS Formatter & Minifier?

A layout-only formatter: it tokenises the stylesheet first, so strings ("a;b"), comments, url(data:…) payloads and the descendant space in "a :hover" are never mangled — the two classic ways naive regex minifiers break CSS.

Minification removes comments (keeping /*! banners), collapses whitespace runs and drops whitespace around braces, semicolons, commas and parentheses, leaving selectors, values and function whitespace such as calc(100% - 2px) untouched.

Every run also reports the byte size before/after, the saving percentage, and a consistency check that both outputs tokenise to the same CSS.

Frequently asked questions

Will minifying break calc() or content strings?

No. Whitespace inside parentheses is preserved (calc(100% - 2px) stays valid) and everything inside quotes or data URIs is copied verbatim — the tokeniser never looks inside strings.

What is the consistency check?

The tool tokenises both the beautified and the minified output and compares the token sequences. If they ever differ it flags an error instead of silently shipping broken CSS.