100% Client-Side Privacy: Your files and data stay in your browser. Nothing is uploaded to our servers.

CSS Minifier

Tokenizer

Compress CSS stylesheets using a string-aware tokenizer that removes comments and redundant whitespace without breaking calc(), strings, or data URIs.

Optional Below-Tool Ad Placement (Disabled by Default)

How to Use CSS Minifier

  1. 1Paste your CSS stylesheet into the input editor.
  2. 2Click 'Minify CSS' to run the state-machine tokenizer.
  3. 3Review the original byte size, minified byte size, and savings percentage.
  4. 4Click 'Copy Minified CSS' or 'Download .css' to save your compressed stylesheet.

Key Features & Privacy

  • ✦Character-by-character state-machine tokenizer that tracks single-quoted strings, double-quoted strings, and `url(...)` tokens so inner content is never corrupted.
  • ✦Preserves required spaces around `+` and `-` operators inside `calc()`, `clamp()`, `min()`, and `max()` functions.
  • ✦Strips `/* ... */` comments, collapses whitespace around `{ } : ; , > ~`, and removes unnecessary trailing semicolons before `}`.
  • ✦Instant size comparison and downloadable `.css` output.

Frequently Asked Questions

Why do naive regex CSS minifiers break `calc(100% - 20px)` or `content: 'a b'`?
Naive regexes strip spaces around `-` inside `calc()` (turning it into an invalid negative token) or collapse spaces inside quoted `content` strings. Our state-machine tokenizer preserves quoted strings and functional math spacing.
Can I keep license comments (`/*! ... */`)?
Yes, enable the 'Preserve `!` License Comments' checkbox to keep `/*! ... */` headers intact.
Optional Before-Related-Tools Ad Placement (Disabled by Default)

Related Developer Tools

Explore more 100% browser-based utilities in this category.

View All 30 Tools →
Popular

JSON Formatter & Validator

Validate, pretty-print, and minify JSON payloads safely using native JSON.parse and JSON.stringify with detailed syntax error reporting.

UTF-8 Safe

Base64 Encoder & Decoder

Encode plain text (including full UTF-8 Unicode and emojis) to Base64 or decode Base64 strings back to readable text with error validation.

RFC 3986

URL Encoder & Decoder

Percent-encode and decode URL components or full URIs safely with support for query string `+` spaces and malformed URI error handling.

Safe Parser

HTML Minifier

Minify HTML code conservatively by stripping safe comments and collapsing inter-tag whitespace while preserving <pre>, <textarea>, <script>, and <style> blocks.

Optional Ad Placement Area (Disabled by Default)