Developer On-device · No upload

CSS Minifier & Beautifier

Compress CSS for production or format messy CSS into readable code — instantly, safely, and fully client-side.

CSS Minifier & Beautifier compresses CSS by stripping comments, collapsing whitespace, shortening hex colors, and trimming leading zeros, or reformats minified CSS into clean, indented code. Strings, url(), and calc() are always kept intact so nothing breaks. Runs entirely in your browser. Made by FreeToolHub.

CSS Input

Output

Frequently Asked Questions

Is my CSS uploaded anywhere?

No. Minifying and beautifying both run locally in your browser using JavaScript. Your stylesheet is never sent to a server, so private or unreleased code stays private.

What does minifying actually change?

It removes comments, collapses whitespace and line breaks, drops the redundant semicolon before a closing brace, shortens 6-digit and 8-digit hex colors to 3 or 4 digits when possible (#ffffff becomes #fff), and trims a leading zero from decimals (0.5 becomes .5). Selector spacing that changes meaning, like the space in "a :hover", is always left untouched.

Will minifying break my CSS?

It is built to be safe by default. Comments, quoted strings, and url() contents (including data URIs) are copied through untouched, and required spacing inside calc() expressions and around media-query keywords like "and (" is always preserved, so the output should render identically to the input.

What is the difference between minify and beautify?

Minify produces the smallest possible output for production, with no line breaks or indentation. Beautify does the opposite: it takes minified or messy CSS and reformats it with one selector and declaration per line and consistent 2 or 4-space indentation, which is useful for reading or debugging someone else's compressed stylesheet.

Does it support @media queries, calc(), and CSS custom properties?

Yes. Media query preludes, calc() expressions, CSS custom properties (--variable-name), nested selector lists, and multi-value shorthand properties are all handled correctly by both the minifier and the beautifier.

Is there a file size limit?

There is no fixed limit. Since everything runs in your browser, performance depends on your device, but typical stylesheets of several hundred kilobytes process instantly.