About the CSS Minifier
Smaller CSS files download faster. This minifier removes comments, line breaks and extra spaces while keeping your rules the same.
Every kilobyte of CSS has to be downloaded and parsed before a browser can show a styled page, so stylesheets sit on the critical path of page speed. Comments, indentation and line breaks help people read code but mean nothing to browsers. Removing them makes the file smaller without changing a single rule, which helps Core Web Vitals and mobile visitors on slow connections.
This minifier strips comments, line breaks and unnecessary spaces around braces, colons and semicolons, and shows how much smaller the result is. Licence comments that start with /*! can be kept, as many open-source licences require. It is meant for quick jobs: a theme file for WordPress, a stylesheet on a static site, CSS for an email template or a snippet you want to inline in the <head> of a page.
How to use the CSS Minifier
- 1Paste your CSS.
- 2Click Minify.
- 3Copy the result and check the size saved.
Key features
- Removes comments, line breaks and extra spaces.
- Optional /*! licence comment preservation.
- Shows original and minified size.
- Copy the minified CSS in one click.
- Runs instantly in the browser.
Practical uses
- Shrinking a WordPress child-theme stylesheet.
- Preparing critical CSS to inline in the page head.
- Reducing CSS size in HTML email templates.
- Minifying CSS for a landing page without a build tool.
Example
A 24 KB hand-written stylesheet with comments and generous indentation typically shrinks by around a fifth to a third. The browser applies exactly the same rules, and with gzip on the server the download becomes smaller still.
Tips and common mistakes
- Keep the readable original in version control and publish only the minified copy.
- Test the page once after replacing a stylesheet, especially if it contains unusual hacks.
- Combine minification with server compression (gzip or Brotli) for the biggest saving.
- Remove unused CSS first; minifying unused rules still sends them to every visitor.
Limitations
- It does not merge duplicate rules or remove unused selectors.
- Syntax errors in the input are not corrected.
Privacy
Your CSS is minified in the browser and not uploaded.
Frequently asked questions
Can minifying break my CSS?
It only removes whitespace and comments, which browsers ignore. Always test once after minifying.
Are /*! important */ comments kept?
Yes. Comments that start with /*! are usually licence notes and are kept.
Should I minify by hand?
For one-off files this tool is fine. In a project, let your build tool (Vite, webpack) minify automatically.
Can I unminify CSS later?
Yes. Paste minified CSS into the CSS Formatter to make it readable again, although removed comments cannot be restored.