Dev Utilities

CSS Minifier

Strip comments and unnecessary whitespace from CSS to produce a smaller file, without the bugs a naive find-and-replace minifier introduces. Whitespace inside a quoted string or url() is left untouched, and the space-sensitive + and - operators inside calc(), min(), max(), and clamp() are preserved exactly, since calc(100% - 10px) and calc(100%-10px) are not the same valid CSS. Modern nested rules and custom properties are handled correctly since the tool only tracks brace, string, and comment state, never tries to parse selectors.

  • Files never leave your device
  • Runs entirely in your browser
  • Free, no account needed
Use CSS Minifier - free

How to use CSS Minifier

  1. 1

    Open the CSS Minifier

    Go to tools.slaytic.com and open the CSS Minifier. No sign-up or account required.

  2. 2

    Paste your CSS

    Paste your stylesheet. It minifies automatically a moment after you stop typing.

  3. 3

    Copy or download the result

    See the exact before-and-after byte size and percentage saved, then copy the minified CSS or download it as a .css file.

How this works in your browser

This tool is a character-by-character state machine, not a regex-based find-and-replace, specifically to avoid the correctness bugs a naive minifier introduces: it tracks whether it is currently inside a quoted string, a comment, or a whitespace-sensitive function like calc(), and only strips or collapses whitespace when none of those apply. A "/*! ... */" banner comment, the standard convention for a license notice, is preserved rather than stripped like a normal comment.

CSS Minifier vs. traditional online converters

FeatureCSS Minifier (in-browser)Traditional online converters
File upload requiredNo - never leaves your deviceYes - file is sent to a server
Processing queueNone - starts instantlyOften, especially at peak times
Watermark on outputNeverCommon on free plans
Usage limitsNone - free, unlimited useOften capped per day or file size
Works offline once loadedYes, for most toolsNo - requires a live connection
Account requiredNoOften, for anything beyond a trial

Who uses CSS Minifier

Frontend developers shipping a build

Shrink a hand-written stylesheet before deploying, without a full build pipeline for a quick one-off file.

Anyone pasting CSS into a size-limited field

Fit a stylesheet into an email template, CMS custom-CSS box, or other field with a character limit.

Checking real byte savings

See the actual before-and-after size of your specific CSS, not a generic claimed percentage.

Frequently asked questions

Is this CSS minifier free?

Yes, completely free with no limit on how much CSS you minify.

Will this break calc() expressions?

No. The tool specifically preserves the spaces around + and - inside calc(), min(), max(), and clamp(), since removing them would produce invalid CSS.

Does it handle CSS custom properties (variables)?

Yes. Custom properties like --gap: 8px 16px; are treated like any other declaration, with meaningful spacing between values preserved.

Does it support modern nested CSS?

Yes. The tool tracks braces generically rather than trying to parse selectors, so nested rules pass through correctly.

What happens to comments?

Regular comments are stripped. A "/*! ... */" comment, the standard convention for a license or attribution banner, is kept.

Is my CSS uploaded anywhere?

No, minification happens entirely inside your browser.

Minify CSS - free, correct, instant.

Open CSS Minifier
  • Files never leave your device
  • No upload required
  • No account needed
  • Unlimited use, always free