CSS Formatter & Minifier
Format, beautify, and minify CSS in your browser. Configure indentation, remove comments, and compare original vs minified size. No upload, no size limit.
How it works
- Format pretty-prints CSS with configurable indentation. Block comments are preserved; line comments are removed (they are invalid in CSS after minification).
- Minify strips all non-essential whitespace and comments, and removes optional semicolons before closing braces.
- The byte count comparison shows input vs output size so you can see the compression ratio immediately.
- Everything runs in your browser — no upload, no server round-trip, no external dependencies.
What minification removes
Minification targets non-functional whitespace: spaces after colons and semicolons, all newlines, trailing optional semicolons, and unit zeros (0px becomes 0). Comments are stripped — both block `/* */` and `//` pseudo-comments that some preprocessors emit. It does not rename classes, remove unused rules, or inline values; those require a build-toolchain optimizer like csso, cssnano, or lightningcss.
Formatting options
The formatter respects browser-native CSS parsing via a lightweight state machine: it handles `@media`, `@keyframes`, `:root`, and nested at-rules, and preserves the structural intent of the original stylesheet. Select 2 or 4 spaces, or tabs, from the dropdown. The output always round-trips correctly — formatting a minified sheet and minifying the result gives the same output.
Next steps
- JavaScript Beautifier— format or minify JS in the same project
- HTML Prettifier— complete the frontend trio
Frequently Asked Questions
How do I minify CSS?
How do I beautify CSS?
Is my data sent to a server?
Do I need an account or API key?
Can I use these tools offline?
All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.