How to Minify CSS Online
Paste your CSS
Copy a stylesheet or a block of CSS rules and paste it into the Input CSS box. The tool processes the text directly in your browser, so nothing is uploaded to a server.
Click Minify CSS
Press the Minify CSS button. The tool strips comments, collapses runs of whitespace into single spaces, and removes the spaces around braces, colons, semicolons, and commas to produce one compact output block.
Check the savings and copy
Read the stats line showing original size, minified size, and bytes saved with a percentage. Use Copy Result to grab the minified CSS, or Clear to reset both boxes and start over.
What This Minifier Changes
This tool performs safe, text-level minification. It removes characters that browsers ignore without rewriting your selectors, values, or property order. The table below shows exactly what it does and does not touch.
| Operation | Applied | Detail |
|---|---|---|
| Comment removal | Yes | Deletes every /* ... */ block comment. |
| Whitespace collapse | Yes | Reduces newlines, tabs, and multiple spaces to a single space. |
| Spacing around symbols | Yes | Trims spaces around braces, colons, semicolons, and commas. |
| Trailing semicolon | Yes | Drops the last semicolon before a closing brace. |
| Color and unit shortening | No | Values such as #ffffff and 0px are left unchanged. |
| Rule merging or reordering | No | Selectors and property order are preserved as written. |
When to Use This Tool
Shipping to production
Minify a finished stylesheet before deploying to cut download size and shave bytes off page load without changing how the CSS renders.
Quick one-off snippets
Ideal for compacting a single component or a pasted block when you do not want to wire up a full build pipeline just to strip whitespace.
Inlining critical CSS
Produce a tight, single-line block that is easy to drop into a style tag in your HTML head for above-the-fold styling.
Skip if you need aggressive optimization
For shorthand collapsing, color reduction, duplicate removal, or autoprefixing, use a dedicated build tool such as cssnano or PostCSS instead.
Common Problems and Fixes
Output looks the same size as input
If your CSS is already compact, there is little whitespace or comments to remove. The savings percentage reflects only the redundant characters this tool can safely strip.
A comment I needed is gone
All /* ... */ comments are removed, including license headers. Keep an unminified copy of the source if you must preserve a banner comment in the file.
Copy Result did nothing
The clipboard copy uses a browser API that requires a secure context. Make sure the page is loaded over HTTPS and that you allowed clipboard access when prompted.
Styles broke after minifying
This tool does not validate CSS, so a missing brace or malformed rule in the input can carry through. Confirm the original CSS is valid before minifying and re-paste the corrected source.