Free Online CSS Minifier
Strip Comments and Whitespace From CSS to Reduce File Size
Need to use CSS Minifier right now?
Well-formatted CSS with comments and consistent indentation is great for maintaining a stylesheet, but every one of those bytes gets downloaded by every visitor on every page load. This tool strips comments and collapses unnecessary whitespace around selectors, braces, colons, and semicolons, shrinking the file without changing any actual styling behavior.
84 → 52 characters (38% smaller)
.card{padding:16px;color:#333}.title{font-size:20px}Other tools in Developer Tools
Features
- Runs entirely in your browser
- Privacy-first — your data is never uploaded
- Real-time, instant results
- 100% free, no sign-up required
- Works on desktop, tablet, and mobile
- No installation needed
Who uses this tool?
People also search for
About CSS Minifier
Well-formatted CSS with comments and consistent indentation is great for maintaining a stylesheet, but every one of those bytes gets downloaded by every visitor on every page load. This tool strips comments and collapses unnecessary whitespace around selectors, braces, colons, and semicolons, shrinking the file without changing any actual styling behavior.
The minifier removes CSS comments entirely, tightens spacing around punctuation (`{`, `}`, `:`, `;`, `,`) down to the minimum needed, and removes the final semicolon before a closing brace where it's redundant. These are purely textual transformations that preserve the exact same computed styles.
This is a lightweight, safe minifier — it doesn't merge duplicate selectors, shorten color values, or perform other more aggressive optimizations a build-tool-level minifier like cssnano would. For quick manual minification of a stylesheet before deployment, it still delivers a meaningful size reduction with zero risk to how your styles render.
How it works
- Paste your CSS. Any formatted stylesheet.
- Comments and whitespace strip automatically. See the size reduction percentage live.
- Copy the minified result. Ready to deploy as a smaller stylesheet.
Examples
Minifying a formatted stylesheet
Input
.card {\n padding: 16px;\n color: #333;\n}Output
.card{padding:16px;color:#333}