CSS Minifier
Minify CSS to reduce stylesheet size.
Minify CSS to reduce stylesheet size.
Related tools
Ready tools are shown first.
Tool guide
Free Online CSS Minifier
Reduce basic CSS source size by removing block comments, collapsing whitespace, tightening common punctuation, and removing the final semicolon before a closing brace. View byte counts and the measured reduction before copying or downloading the minified CSS.
Steps
How it works
- Paste CSS or choose one CSS or TXT file.
- Run the minifier to remove comments and unnecessary text whitespace.
- Review the minified output and byte-size reduction.
- Copy the result or download a minified CSS file.
Highlights
Key features
- Removes all CSS block comments matched by the minifier.
- Collapses whitespace and removes spaces around common CSS punctuation.
- Removes a trailing semicolon immediately before a closing brace.
- Shows original size, minified size, and percentage reduction.
- Supports pasted CSS plus CSS or TXT file input with copy and download actions.
Use cases
Common uses
- Create a smaller CSS text file for a simple website.
- Minify CSS snippets before embedding them.
- Compare source and minified byte sizes.
- Remove formatting whitespace from straightforward stylesheets.
Notes
Limitations to know
- The minifier is regex-based and does not parse or validate CSS.
- All matched block comments are removed, including license or preservation comments.
- Whitespace or punctuation inside quoted strings, custom values, and data URLs may be changed incorrectly.
- It does not merge rules, shorten colors, remove zero units, remove unused CSS, generate source maps, or perform document-level optimization.
- Minification is not Gzip or Brotli compression, and no specific size reduction is guaranteed.
FAQ
Frequently asked questions
Does CSS minification change behavior?
It should be reviewed carefully. The regex-based minifier may alter meaningful characters or whitespace inside complex strings and values.
Are CSS comments removed?
Yes. All block comments matched by the tool are removed, including comments you may need to preserve.
Is CSS minification the same as Gzip?
No. This tool rewrites CSS text. Gzip and Brotli are transport compression formats typically applied by a web server.
Does it remove unused CSS?
No. The tool does not inspect HTML or analyze which selectors are used.
Why was the size reduction small?
Already compact CSS has little removable whitespace or comment content, so the measured reduction may be small.
Can the original formatting be restored?
Not exactly. Use the original source or version control; a formatter cannot recover removed comments or exact whitespace.