Minify CSS by removing comments and unnecessary whitespace.
Processed locally — your code is never uploaded.
How do you minify CSS?
A CSS minifier removes comments and collapses runs of whitespace while preserving the meaning of the styles, so the file downloads faster. Minified CSS is functionally identical but smaller — a commented, indented stylesheet typically shrinks by 20–50%. Keep an unminified copy for editing, since the compact version is hard to read and maintain.
Understanding your result
Minified CSS is functionally identical but smaller. Keep an unminified copy for editing.
Formula and method
Comments are removed and runs of whitespace collapsed, while preserving the meaning of the styles.
Assumptions and limitations
Minifying removes comments and collapses whitespace but keeps your styles functionally identical; it does not rename selectors, merge duplicate rules, remove unused CSS, or optimise property values. Always keep an unminified source copy for editing, since the compact output is much harder to read and maintain by hand.
Worked example
A commented, indented stylesheet typically shrinks by 20–50%.
How to use this tool
- Paste your CSS.
- Copy the minified output and the size saved.
Common mistakes to avoid
- Minifying the only copy of your source — always keep the original.
About the CSS Minifier
Shrink your CSS by stripping comments and unnecessary whitespace so it downloads faster.
Who should use this tool
Front-end developers and site owners shrinking stylesheets to speed up page loads, and anyone preparing CSS for production who lacks a full build pipeline. Handy for a quick one-off minify of a hand-written stylesheet or a snippet copied from documentation before pasting it into a live site.
Benefits
- Strips comments and redundant whitespace to cut file size
- Keeps the styling behaviour completely unchanged
- Speeds up page loads by shrinking the download
- Processes your CSS entirely in the browser
Practical use cases
- Compressing a stylesheet before deploying to production
- Quickly minifying CSS without a build tool
- Reducing the size of an inline style block
- Trimming a snippet copied from documentation
Explore all Developer Tools tools
Frequently asked questions
Is anything uploaded?
No. Minification happens entirely in your browser.
Will minifying my CSS change how the page looks?
No. Minification only removes comments and unnecessary whitespace, which the browser ignores anyway. The rules, selectors, and property values stay exactly the same, so the rendered page is identical. The only difference is a smaller file that downloads and parses faster.
Can I edit minified CSS later?
You can, but it is difficult because everything sits on few lines with no comments or indentation. The best practice is to keep your original, readable stylesheet as the source of truth, make edits there, and re-run the minifier to produce a fresh compact version for deployment.