About the CSS Minifier
Smaller stylesheets download faster, which improves page speed and Core Web Vitals. The CSS Minifier strips comments, whitespace and redundant characters while keeping your styles working the same.
You can see original and minified sizes and percentage saved, then copy or download the result.
How to use the CSS Minifier
- Paste your CSS code.
- Choose minification options.
- Click minify.
- Copy or download the minified CSS.
Key features
- Removes comments and whitespace
- Size savings report
- Syntax highlighting
- Download as .css
What minification removes
Minifying CSS deletes comments, line breaks and indentation, removes the last semicolon in each rule, shortens zero values and drops unnecessary spaces around symbols. Browsers ignore all of these, so the styles work exactly the same while the file becomes smaller, typically by 15 to 30 percent before compression.
Smaller files download and parse faster, which helps metrics such as First Contentful Paint. The savings add up on sites with large frameworks or many stylesheets.
Common uses
- Preparing stylesheets for a production website.
- Reducing the size of CSS embedded in emails or HTML pages.
- Shrinking theme files before uploading them to a CMS.
- Quick optimisation when no build tool is available.
Tips for the best results
- Keep the original, readable file for editing and minify a copy.
- Enable gzip or Brotli compression on your server for further savings.
- Test the page after replacing the stylesheet.
- Combine several small stylesheets into one before minifying to reduce the number of requests the browser makes.
Frequently asked questions
Will minifying break my CSS?
No. Minification only removes characters that browsers ignore.
Should I keep the original file?
Yes. Edit the readable version and minify again when you deploy.
How much size can I save?
Typically 15 to 30 percent, more if your CSS has lots of comments.
Does it remove unused CSS?
No. Minification keeps every rule. Removing unused selectors requires a tool that scans your HTML.
Can I un-minify CSS later?
Formatting tools can re-indent minified CSS, but comments removed during minification cannot be recovered.
Does it support modern CSS such as variables and grid?
Yes. Custom properties, grid, flexbox and media queries are kept intact.