CSS Minifier
Minify CSS without rewriting it: strip comments and whitespace, keep variables, media queries and fallbacks.
CSS Minifier
Keeps top-level /*! … */ comments, which often hold copyright notices. All other comments are removed.
Paste code, choose a file or drop one here (up to 3.00 MB). Everything runs in your browser — the code isn't uploaded or run.
Your data is processed locally in your browser and is not uploaded to OZVILO servers.
How to use the CSS Minifier
- 1Paste CSS, choose a .css file, or drop one onto the box.
- 2Choose whether to keep /*! licence comments.
- 3Press Minify CSS and check the size saved and any parsing notes.
- 4Copy the result or download it as .min.css.
Examples
Readable stylesheet
- Input
- .card { padding: 1rem; color: var(--text); }
- Result
- .card{padding:1rem;color:var(--text)}
Modern syntax
- Input
- @media (width >= 600px) { .a { &:hover { color: red } } }
- Result
- @media (width>=600px){.a{&:hover{color:red}}}
CSS Minifier features
- Removes comments and unnecessary whitespace using css-tree, a maintained CSS parser
- Keeps custom properties, calc(), clamp(), color-mix(), nesting, @layer, @container and @supports
- Keeps strings, url() and data URLs exactly as written, including Unicode and escapes
- No restructuring: rules, vendor prefixes and fallbacks stay in their original order
- Reports anything it can't parse (kept as written); size savings in bytes and percent
Frequently asked questions
Why doesn't it merge rules or remove duplicate properties?
Declarations like width: 100px; width: calc(100% - 10px) are often deliberate fallbacks for older browsers. Merging or removing them can change how a page looks somewhere, so this minifier only removes comments and whitespace.
Does it support modern CSS?
Yes — custom properties, nesting, range media queries, @layer, @container, @scope, :has() and new colour functions are kept as written.
What happens with invalid CSS?
Parts the parser can't understand are kept exactly as written and listed with their line numbers, so nothing is silently dropped.
Is my CSS uploaded?
No. It's minified in your browser.
Related tools
- Available
HTML Minifier
Minify HTML safely: remove comments and extra whitespace while keeping scripts, styles and <pre> intact.
SEO ToolsOpen tool - Available
JavaScript Minifier
Minify modern JavaScript and ES modules with Terser, with optional name shortening and source maps.
SEO ToolsOpen tool - Available
Page Size Checker
Measure a page's HTML, CSS, JavaScript, images and fonts — transfer and uncompressed sizes reported separately.
SEO ToolsOpen tool - Available
Core Web Vitals Checker
See real-user LCP, INP and CLS from the Chrome UX Report, with lab data shown separately.
SEO ToolsOpen tool