CSS Minifier

Free CSS minifier. Compress CSS by stripping comments, whitespace, and unnecessary separators, with a reported size saving in bytes and percent.

AI-ready Use this tool with AI

This tool has a free JSON API. Copy a prompt or skill below to use it with ChatGPT, Claude, or any AI agent — no API key needed.

API docs
Paste your CSS above.

How css minifier works

CSS minification shrinks a stylesheet by removing everything the browser does not need: comments, redundant whitespace, and the spaces around braces, colons, semicolons, and commas. The minified file is functionally identical but smaller, so it downloads and parses faster.

This minifier removes /* ... */ comments, collapses all runs of whitespace to a single space, strips spaces around CSS punctuation, and drops the trailing semicolon before a closing brace. It reports the original size, the minified size, and the saving in bytes and as a percentage.

Paste your CSS and click Minify. The tool is a fast, safe transform that preserves selectors, properties, values, and at-rules. For production you may also want a full optimizer that rewrites shorthand and merges rules, but for most stylesheets this minifier captures the bulk of the saving.

Frequently asked questions

What does minification remove?
Comments, redundant whitespace, and spaces around braces, colons, semicolons, and commas, plus trailing semicolons before a closing brace. The CSS rules themselves are unchanged.
Will minification break my CSS?
No. The transform preserves selectors, properties, and values. The minified file is functionally identical to the original — only the human-readable formatting is removed.
How much size can I save?
It depends on how verbose the original CSS is, but 30 to 50 percent is typical for hand-written stylesheets with comments and indentation. The tool reports the exact saving.
Is this enough for production?
For most sites yes. If you want further savings, a full optimizer can merge duplicate rules and rewrite properties into shorthand, but that risks changing behaviour and is best left to a dedicated build tool.