Skip to main content
ToolsBay

Runs in your browser — nothing is uploaded · verify

CSS Minifier — free, and it runs in your browser

Strip comments and whitespace to shrink a stylesheet.

  • No build step and nothing to install — paste a stylesheet and take the result.
  • The saving is reported in bytes and as a percentage of the original.
  • Strings, calc() and at-rule preludes are left intact.

Your CSS

Tab indents · Esc then Tab to leave1 line

Minified

1 line
  • 70 tools

    Free, with no account and no watermark

  • 0 bytes

    Of your files or text uploaded — this tool runs in the tab

  • No queue

    The work happens in this tab, not in a line behind other users

Three steps, nothing to install

CSS Minifier in three steps

  1. CSS123456Paste it in — it never leaves the tab

    Paste your stylesheet

    A whole file or a single component’s rules.

  2. CSSCSSConverted on your own device

    Minify it

    Comments and redundant whitespace go. The tokeniser tracks where it is in the document, so the parts where whitespace matters are preserved.

  3. Copy CSS

    Copy the smaller file

    With the exact byte saving shown, so you know whether it was worth it.

Why use CSS Minifier

  • Whitespace is significant in three places

    Inside strings, inside calc() and inside at-rule preludes, removing a space changes what the CSS does. A regex-based minifier corrupts all three, which is why this one tokenises.

  • Exact, not approximate

    The numbers on screen are measured from your actual input rather than estimated, so you can act on them without checking elsewhere.

  • Your text stays in the page

    What you paste is not transmitted or stored, so an API response full of customer records, a token or an internal query never leaves your machine.

Frequently asked questions

It should not. Quoted strings and url() contents are copied through untouched, and spaces that carry meaning — the descendant combinator, values in a shorthand, operators inside calc() — are preserved. Naive minifiers get all three of those wrong.

What minification actually removes

CSS minification strips what the browser does not need: comments, indentation, line breaks, the final semicolon in a block, and empty rules. How much that saves depends on how the stylesheet was written: run through this minifier, four open-source stylesheets lost between 15% and 63% of their bytes, and between 10% and 58% after gzip at level 9. Comment-heavy files gain the most.

Where naive minifiers break stylesheets

The common shortcut is a regular expression that deletes whitespace around {, }, :, ; and ,. It fails in four places that appear in real code:

  • Inside strings — content: "hello, world" loses the space after the comma, changing what the page renders.
  • In calc() — calc(100% - 2rem) becomes calc(100%-2rem), which is invalid and drops the declaration.
  • In selectors — a :hover becomes a:hover, a completely different selector.
  • In at-rules — @media (min-width: 600px) becomes @media(min-width:600px), which is not valid.

This minifier tokenises the stylesheet instead, so those cases survive. Beautify reverses the process when you need to read minified CSS.

For the markup around your styles, see the HTML beautifier, and for scripts the JavaScript formatter.

More tools

70 tools, none of which want your file

Everything this tool does happens in the page you are looking at. No account, no upload, no watermark.