Free CSS Formatter & Minifier
Stylesheets copied from DevTools arrive flattened; legacy files mix tabs, spaces, and dead commented code. This free tool formats CSS into clean one-declaration-per-line style with proper brace indentation, and minifies it for production — stripping comments, collapsing whitespace, dropping redundant semicolons, and normalizing zero units — all locally in your browser.
How to Use It
- Paste your CSS — full stylesheets,
<style>contents, or snippets. - Format for readable code with
selector {openings, indented declarations, and closing braces on their own lines. - Minify before deploying: comments, extra spaces, and
0px → 0cleanups shrink files 20–40%.
What Minification Actually Removes
Beyond whitespace, the minifier deletes /* */ comments (including license headers — keep those in source), the semicolon before every closing brace, and units on zero values where CSS allows unitless zero. Strings in content and url() are parsed carefully so quoted text survives byte-identical. The result is render-identical CSS that downloads and parses faster on every visit.
Is minified CSS hard to debug?
Yes — always keep the formatted source and deploy the minified build, ideally with source maps from your build tool. This page is for quick jobs; large projects belong in a proper pipeline.
Does minifying break any CSS?
The transforms applied here (whitespace, comments, trailing semicolons, zero units) are semantics-preserving per the CSS spec. Exotic hacks relying on exact whitespace are vanishingly rare in modern stylesheets.
Is my stylesheet uploaded?
No — parsing and output happen entirely in page JavaScript on your device.
Related Tools
Format markup with the HTML Formatter, shrink scripts with the JS Minifier, and convert colors with the Color Converter.