Minify CSS
Remove unnecessary comments and whitespace from CSS to reduce its size before publishing it.
Processed on your device. Nothing is sent to any server.
Removes comments and whitespace around braces, colons and semicolons, reducing the file size without changing the styles it applies.
Use cases
- Reducing a stylesheet's size before publishing it.
- Optimizing a website's load time.
- Preparing compact CSS to embed in an inline <style>.
How it works
- 1
Paste your CSS
Type or paste the formatted CSS code.
- 2
Minify it
Click Minify and copy or download the compact result.
Technical details
- It removes comments, spaces around { } : ; , and each block's last semicolon. Example: ".a { margin : 0 auto ; }" → ".a{margin:0 auto}".
- Quoted text is kept exactly as written (for example in content: "…" or url("…")).
- It doesn't shorten colors, merge rules or drop unused selectors: it's whitespace reduction, not a full optimization like cssnano.
- A space before a colon in a selector (a :hover, which in CSS means "hovered descendant") is removed and changes the meaning; it's rare, but check it if you use it.
Frequently asked questions
Could it break my CSS?
Minification is conservative (it only collapses whitespace and removes comments), but it's always good practice to visually check the result before publishing it.
Related tools
- HTML MinifierReduces an HTML file's size.
- Border Radius GeneratorCreates CSS border-radius with preview.
- Box Shadow GeneratorCreates CSS shadows with a live preview.
- Color PickerPick a color and get HEX, RGB and HSL.
- WCAG Contrast CheckerChecks WCAG contrast between two colors.
- CSS FormatterFormats CSS to be readable.