Skip to content

CSS Minifier

Minify CSS without rewriting it: strip comments and whitespace, keep variables, media queries and fallbacks.

AvailableRuns in your browserFree · No sign-up

CSS Minifier

Keeps top-level /*! … */ comments, which often hold copyright notices. All other comments are removed.

0 B

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

  1. 1Paste CSS, choose a .css file, or drop one onto the box.
  2. 2Choose whether to keep /*! licence comments.
  3. 3Press Minify CSS and check the size saved and any parsing notes.
  4. 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.