This tool runs entirely in your browser. Nothing you paste is uploaded.
How you can check →CSS Minifier
Text & DataMinify or beautify CSS in your browser. Nesting, custom properties and browser hacks survive by construction, and the receipt shows the gzip size a browser actually downloads.
The minified CSS appears here.
No network activity while you use this tool Show the numbers
- Requests to any other server
- 0
- Requests since you started typing
- —
- Same-origin requests
- 0
Counted live by your browser's own Performance Timeline — the same data the DevTools Network panel reads. It cannot see what a browser extension does, and it is not meant to replace checking for yourself: here is how, in thirty seconds .
Minified or gzipped — which number matters?
Every CSS minifier reports raw bytes saved, and no browser has ever downloaded raw bytes —
real transport runs through gzip or brotli first. Measured on Bootstrap 5.3.3's CSS: minifying
alone takes 281,046 bytes down to 232,803, a 17.2% raw saving. Once gzip runs on both files,
the gap narrows to 33,308 versus 30,829 bytes — a 7.4% saving. Gzip was already eating most of
the redundancy that whitespace and comments represent, because whitespace compresses
extremely well on its own. For a CSS file the size question is not "how much smaller is the
raw file" but "how much smaller does it arrive" — and this tool's Size tab answers the second
one, measured in your own browser with CompressionStream, never estimated.
What this minifier will not do to your file
Measured on 2026-09-10 against a fixture containing .e{ &:hover{
color:blue }}: clean-css 5, csso 4 and the Toptal cssminifier API (the
top-ranking result for "css minifier") all delete the rule entirely. HTTP 200, no warning, no
error — a block of styling simply disappears. CSS Nesting reached every target browser in
2023 and is now ordinary in hand-written CSS, so this is not an edge case; it is what happens
to any stylesheet using the syntax you would naturally reach for today. This tool's parser is
nesting-native from the ground up: a rule's block may contain nested rules and nested at-rules
at any depth, because that is what the spec actually allows.
The same fixture set catches two more failure modes worth knowing about. A custom property's
value — --x: 0.50s — is a token stream substituted verbatim by
var(); one popular engine rewrites the inside of a custom property block, which
changes a value a script or a @property registration may be reading by exact
text. This tool trims only leading and trailing whitespace on a custom property and never
touches anything else. And browser hacks — *zoom:1, _height,
color:red\9 — are invalid CSS that specific old browsers intentionally honour;
one engine drops them, another keeps them inconsistently. This tool keeps every hack by
default and lists what it found, so removing one is a choice you make, not one made for you.
Minification is not obfuscation
Minified CSS is trivially beautified back — this page's own Beautify mode does exactly that — so it provides no secrecy for a design system or a paid theme. It is also not compression: gzip and brotli do the actual byte-shrinking work at transport time, and minifying mostly removes the redundancy gzip would otherwise have compressed for you (see the gzip section above). What minifying genuinely buys you is a smaller file before compression even starts, which matters most for CSS that is already dense with data URIs or long class names that gzip handles less efficiently.
Common use cases
- Shrinking a stylesheet before shipping it, while keeping licence notices intact
- Checking whether minifying a particular file is worth the risk once gzip runs
- Reading a minified third-party stylesheet by beautifying it first
- Confirming a nested rule or browser hack survived a build step unchanged
- Seeing which option — comments, whitespace, colour shortening — earned which bytes
Frequently asked questions
- Does minifying CSS break nested rules?
- On the three most common free minifiers, yes — measured 2026-09-10, clean-css 5, csso 4 and the Toptal cssminifier API all silently delete a rule nested with the & selector, with no warning. This tool's parser is nesting-native, so a nested rule survives minification intact.
- Is it safe to remove comments from CSS?
- Ordinary comments, yes. Licence comments — /*! ... */ or /** @license ... */ — are a legal object: MIT, BSD and Apache all require the notice to travel with the code. This tool keeps licence comments by default and tells you how many it kept, and only drops them if you turn that off explicitly.
- Why is my minified CSS barely smaller after gzip?
- Minifying strips whitespace and comments, which gzip already compresses away almost for free — measured on Bootstrap 5.3.3's CSS, minifying saves 17.2% raw but only 7.4% once gzip runs, because gzip was already eating most of that redundancy. The Size tab on this page shows both numbers so you can see which one your file actually needs.
- Can I get my original CSS back from a minified file?
- Structurally, yes — the Beautify mode re-indents a minified file into readable CSS. What does not come back is anything the minifier discarded: comments, and any exact whitespace choices you made. Rule order, selectors and values return unchanged, because this tool never merges or reorders them.
- Does this upload my CSS anywhere?
- No. Minifying, beautifying and verifying all run in this tab's own JavaScript. The privacy receipt below the tool measures the actual network requests this page made, so the claim is checkable rather than asserted.
- Which minifier does this use?
- A hand-written parser built for this site, not a wrapped copy of clean-css or csso. It was written nesting-native from the start because that is exactly where the popular libraries fail (§5.1) — see "What this minifier will not do to your file" below for the measured comparison.
Explore more tools
Minify HTML without collapsing the whitespace that changes how your page looks.
Build linear, radial and conic CSS gradients, and see the same stops fade through grey in sRGB or stay vivid in OKLCH.
Convert HEX, RGB, HSL, OKLCH, CMYK and more — and see which values survive the trip back.