A small standalone snippet
Compact straightforward declarations for a constrained embed or handoff.
Keep the original comments and formatting in source control; the output is a derivative.
Remove CSS comments and unnecessary whitespace, show size savings, and copy or download the minified stylesheet.
Content last reviewed
43 characters · 4 lines
Overview
Remove block comments, collapse whitespace, tighten common punctuation, and drop a trailing semicolon before a closing brace. The page now measures real UTF-8 byte counts, while its limitations explain why complex strings, data URIs, hacks, and recovery from invalid CSS require a proper parser and rendering test.
Comments, whitespace runs, punctuation spacing, trailing semicolons, and edge whitespace are transformed.
Original and minified values use Blob byte lengths, with a percentage derived from those bytes.
The tool does not claim to understand the CSS grammar or prove an identical rendering.
Copy or download the live output while keeping the readable source as the canonical file.
How it works
Three steps, in the order the tool above actually takes them.
Use source without preprocessors and avoid relying on unusual comment-like sequences in strings or URLs.
Inspect the transformations rather than treating the percentage as a correctness signal.
Compare representative pages and use the project's parser-backed build minifier for production CSS.
Use cases
The jobs this page is usually opened for, and the setting that makes each one quick.
Compact straightforward declarations for a constrained embed or handoff.
Keep the original comments and formatting in source control; the output is a derivative.
Show how comments and whitespace affect source bytes without changing selector intent.
Use simple CSS in the demonstration so regex limitations do not obscure the lesson.
Estimate how much uncompressed source weight is common whitespace and commentary.
Measure compressed transfer size in the deployment pipeline; gzip or Brotli changes the practical saving.
CSS has grammar and context
A parser knows whether characters appear in a comment, string, URL, custom property, or declaration. These compact rules do not carry that context, which is why the page is scoped to simple input and mandatory testing.
| Construct | Regex risk | Production handling |
|---|---|---|
| Comment-like string | Every /* ... */ sequence is definitely a comment. | A parser can distinguish token context; this page's first rule cannot. |
| Whitespace | Every space is removable without affecting token boundaries. | Some grammar positions require separation; parser-backed minifiers preserve it contextually. |
| Invalid CSS | Minification preserves the browser's recovery behavior. | Fix and validate the source before optimizing; recovery can change after text is rewritten. |
| Unused rules | A smaller result means dead selectors were removed. | No usage analysis, cascade analysis, or selector merging runs here. |
Every /* ... */ sequence is definitely a comment.
A parser can distinguish token context; this page's first rule cannot.
Every space is removable without affecting token boundaries.
Some grammar positions require separation; parser-backed minifiers preserve it contextually.
Minification preserves the browser's recovery behavior.
Fix and validate the source before optimizing; recovery can change after text is rewritten.
A smaller result means dead selectors were removed.
No usage analysis, cascade analysis, or selector merging runs here.
Privacy
The stylesheet is transformed locally and is not uploaded or autosaved. The split divider alone may persist for the current tab session.
Encoding, parsing, formatting, generation, comparison, and cryptographic operations run in browser code. Form values and uploaded text files are not sent to a processing API.
Code, tokens, secrets, URLs, and generated outputs stay in component memory until the page reloads or closes. Split-pane tools remember only the divider percentage for the current tab session.
The page reads the clipboard only after a Paste action and writes it only after Copy. A local download is created only when you choose the tool's download control.
The page shell can send the tool slug, never the editor contents or filename. The endpoint is rate-limited using a transient requesting address and is skipped for Do Not Track or Global Privacy Control.
More detail in how processing works and our privacy policy.
Limits
The values this tool actually enforces, not a rounded-up version.
This is a regex-based whitespace minifier, not a CSS parser. It does not merge duplicate selectors, shorten colours or units, remove unused rules, add vendor prefixes, or understand @media and @supports structure. Unusual constructs — comment-like text inside a data URI, for instance — can confuse it, so check the output on anything complex.
FAQ
The ones that actually come up.
Guides