When to use the CSS Minifier
Faster websites
Smaller stylesheets download and parse faster, especially on mobile connections.
WordPress and Shopify themes
Minify custom CSS before pasting it into a theme’s Additional CSS box.
Email templates
Reduce the size of embedded styles to keep emails under clipping limits.
Quick builds without tools
Get production-ready CSS without setting up a build pipeline.
Inline critical CSS
Minify the small set of styles needed for the top of a page before inlining it in the head, so the first screen paints quickly.
Features and benefits
- Removes comments and unnecessary whitespace
- Keeps required spaces inside calc() and in descendant selectors
- Never touches text inside quotes
- Optionally keeps /*! license comments
Example
.card {
margin: 0 auto;
width: calc(100% - 2rem);
}.card{margin:0 auto;width:calc(100% - 2rem)}How the CSS Minifier works
ConvertNest scans your stylesheet character by character. It removes comments (except /*! comments if you choose to keep them), collapses whitespace, removes spaces around { } : ; , and > where they are not needed, and drops the last semicolon in each block. Strings and url() values are copied exactly, and spaces that matter – inside calc() or between descendant selectors such as .nav a – are kept.
A real-life example
A freelancer finishes a 28 KB stylesheet for a client’s landing page. Minifying it brings the file to 19 KB, and with the hosting company’s gzip compression it transfers at about 5 KB. Google PageSpeed Insights stops flagging “Minify CSS”, and she keeps the original, commented file in the project folder for future edits.
Good to know
Browsers ignore comments and most whitespace in CSS, so removing them makes the file smaller without changing how the page looks.
Some spaces matter. The spaces around + and - inside calc() are required, and “div :hover” (any hovered element inside a div) means something different from “div:hover”. ConvertNest keeps those spaces.
This minifier does not merge rules or rewrite values. Build tools such as Lightning CSS or cssnano go further for large projects.
Tips for the best results
- Always keep the original, readable CSS for editing.
- Keep /*! license comments when using third-party code that requires attribution.
- Test the page after minifying, especially complex calc() and grid expressions.
- Combine several small stylesheets before minifying to cut HTTP requests too.
- Run PageSpeed Insights before and after to see the effect on your own pages.
Common mistakes to avoid
Editing the minified file
Changes are hard to read and easily broken. Edit the original and minify again.
Minifying Sass or Less source
Compile to plain CSS first; preprocessor syntax is not CSS.
Expecting dead CSS to be removed
Unused selectors are kept. Removing them needs a coverage tool.
CSS Minifier – frequently asked questions
Will minifying break my CSS?
It is designed to be safe: only comments and whitespace that browsers ignore are removed. Always test the result on your site.
What are /*! comments?
Comments starting with /*! are a convention for license notices that must be kept. Leave the option on to preserve them.
How much smaller will my CSS be?
Typically 15–30% for hand-written, well-commented CSS. Server compression adds a further large reduction.
Can I un-minify CSS?
Not with this tool. Most code editors can reformat CSS for you.
Is minified CSS bad for SEO?
No. Search engines read minified CSS fine, and faster pages are better for users.
Does it support CSS variables and media queries?
Yes. Custom properties, @media, @supports and @layer rules are kept intact.
Should I minify CSS if my host uses gzip?
Yes. The two work together: minifying removes comments and whitespace that compression cannot remove entirely, and compressed minified files are usually the smallest.
Will source maps be created?
No. Keep your original file next to the minified one so you can find and edit rules easily.