CSS Minify
Drop a stylesheet into the editor and get a minified version with block comments removed and runs of whitespace squeezed to single spaces. Useful for a quick size check or when you need a compact snippet without running a full build.
Updated 2026-08-03 · developer
About this tool
Minification reduces transfer size by deleting comments and unnecessary whitespace. This tool is a lightweight browser pass—not a full CSS parser—so it will not rewrite selectors or shorten color values. Keep a formatted source elsewhere; treat the output as a compressed copy for delivery or comparison.
How to use
- Open CSS Minify: Open this page in your browser.
- Paste CSS: Put your stylesheet or fragment into the Code box.
- Copy the result: Take the compacted output from the result area.
- Verify in context: Paste into your page or bundler and confirm styles still apply.
Common use cases
- Compress a small CSS snippet before pasting into a CMS field.
- Compare roughly how much whitespace costs in a stylesheet.
- Prepare inline critical CSS for a quick demo.
- Clean commented draft styles before sharing a gist.
Tips
- Strings or urls that contain /* */ sequences are rare but can break naive comment stripping—review output for critical CSS.
- Keep your original formatted file; minified CSS is hard to edit later.
FAQ
Does this rename classes or merge rules?
No. It only removes comments and collapses whitespace.
Are @media and nested rules preserved?
Structure stays as text; only comments and extra spaces are changed.
Is my CSS uploaded?
Processing runs locally in the browser.
Why might output look wrong?
Edge cases in comments inside strings can confuse a simple stripper—double-check important sheets.