← Back to tools

CSS Minifier

Compress CSS by removing whitespace, comments, and unnecessary characters.

Input
Output

CSS minification reduces file size by removing characters that browsers don't need: whitespace, line breaks, comments, and unnecessary semicolons. A typical CSS file can shrink by 20-40% after minification, which means faster page loads and lower bandwidth costs.

Minification is safe because CSS syntax doesn't depend on whitespace (unlike Python). The browser parses body{margin:0;padding:0} identically to a nicely indented version. However, minification is a one-way operation for readability — always keep your source files formatted and minify only for production.

For production sites, minification is typically part of a build pipeline (Webpack, Vite, PostCSS). But for quick one-off minification — a snippet for an email template, an inline style block, or a quick size check — this browser-based tool is faster than setting up a build tool.

This tool in other languages:

Français:
Minificateur et compresseur CSS

Español:
Minificador y compresor CSS

Deutsch:
CSS-Minifier und Kompressor

Português:
Minificador e compressor CSS

日本語:
CSS圧縮ツール

中文:
CSS 压缩工具

한국어:
CSS 압축기

العربية:
أداة ضغط CSS

Frequently asked questions

How do I minify CSS online for free?

Paste your CSS into the input box and click Minify. Whitespace, comments, and redundant characters are stripped, giving you a production-ready CSS string. Click Copy to grab it. The tool also shows the size reduction as a percentage.

What does minifying CSS actually do?

It removes every character the browser doesn't need: line breaks, indentation, spaces between selectors and properties, trailing semicolons on last declarations, and all comments. Shorthand values are collapsed where safe. The functional CSS is identical — only file size changes.

How much can I expect to save by minifying CSS?

Typical savings are 20-40% for raw hand-written CSS, and 10-20% for already-tidy CSS (Prettier-formatted). Gzip compression on your server adds another 70-80% reduction on top of minification. The combination is why every production site serves minified, gzipped CSS.

Should I manually minify CSS or use a build tool?

For any real project, use a build tool — Vite, Webpack, Parcel, and esbuild all minify CSS automatically during production builds. This tool is for quick one-offs: inspecting a minified file, minifying a small snippet for an inline style, or testing what your CSS looks like compressed.

Can I reverse minified CSS back to readable format?

Yes — click Beautify to add proper indentation and line breaks back. Comments that were stripped can't be recovered (they're gone for good), but the structure becomes readable again, which is useful for inspecting a third-party minified stylesheet.