CSS Minifier
Minify CSS
Conservative minification: strings, url() tokens and calc() spacing are preserved. For production pipelines consider lightningcss or cssnano — this tool is for quick, safe, in-browser compression.
About this tool
This free CSS Minifier compresses your stylesheets to their smallest practical size by removing everything the browser does not need: indentation, line breaks, comments, and the final semicolon before each closing brace. Paste your CSS — a full stylesheet, a theme file, a component's styles — and the minified result appears instantly, ready to deploy. Nothing to install, no account needed; minification happens as you paste. CSS is unusually forgiving of whitespace, which makes it unusually compressible. A stylesheet written for humans — selectors on their own lines, one property per line, sections separated by comments — can lose the majority of its bytes without changing a single computed style. Every rule, every property, every value survives exactly as written; what disappears is only the presentation-for-humans layer. The browser applies the identical styles either way, but the minified file downloads faster, parses faster, and costs less on every page load. The economics compound across a site's traffic. A 40 KB stylesheet minified to 22 KB saves 18 KB per request — trivial once, but multiplied by every page view, every returning visitor, every cached-or-not load across a month, that single file's minification is a real bandwidth and speed win. Stylesheets are also render-blocking by nature: the browser typically waits for CSS before painting anything, so every kilobyte removed from CSS is a kilobyte removed from the critical path — the straightest line between minification and a visibly faster site. Everything runs locally in your browser. Your CSS is processed entirely by client-side JavaScript — nothing is uploaded, logged or stored on any server. Stylesheets contain your design system: proprietary class names, internal color tokens, the architecture of your product's look. You can minify all of it with confidence, even offline once the page has loaded.
Frequently asked questions
What does CSS minification actually remove?+
The bytes the browser ignores: indentation, line breaks, spaces around selectors and braces, comments, and the final semicolon of each declaration block. Every rule, selector, property and value survives exactly as authored — a minified stylesheet produces pixel-identical rendering to the original. Typical savings run 20–40% on human-written CSS, more on heavily commented or deeply indented files.
How do I minify CSS online with this tool?+
Paste your CSS into the input area — the minified result appears live, with original and minified sizes shown so you see the exact saving. Copy it with one click and deploy wherever the original lives: a .css file, a <style> block, a build output. Paste-in, minify-out; nothing else to configure, because CSS minification needs no options to be safe.
Can minified CSS break my styles?+
Not when the input is valid CSS — minification only touches syntax the spec declares optional (whitespace, comments, trailing semicolons), and the minified result is byte-for-byte equivalent in meaning. The edge cases worth knowing: CSS hacks and comments used as license notices get removed with all other comments (keep license headers out of minified files or check their terms); and malformed CSS — a missing brace, an unclosed string — behaves no differently minified than not, since browsers already skip broken rules.
Should I minify CSS if my server uses gzip or brotli?+
Yes — minification and compression multiply instead of substituting. Removing bytes before gzip runs produces smaller output after gzip runs; the savings stack. Minified CSS also compresses *better* proportionally, since the encoder works with less redundancy. And compression is not universal: some CDNs, embedded contexts and email pipelines ship raw bytes, where minification is the only saving available. The correct answer is both layers, always.
Does minifying CSS remove my animations, media queries and variables?+
No — every construct in modern CSS survives minification intact: @keyframes and animations, @media queries, CSS custom properties (--variables), @supports, grid and flex declarations, container queries. Minification operates on syntax the parser ignores, never on rules the browser evaluates. A stylesheet using the newest platform features minifies exactly as safely as one written a decade ago.
Does my CSS get uploaded to a server when I minify it here?+
No. All minification happens locally inside your browser using client-side JavaScript — your stylesheet never leaves your device, is never transmitted, and is never logged or stored. After the page loads you can disconnect from the internet and minification keeps working. That makes it safe for proprietary design systems, unreleased product styling and any CSS you would rather keep on your own machine.
Should I minify CSS during development or only in production?+
Only in production — and never edit the minified output. Development should run on formatted CSS: readable, commented, diffable, so reviews and debugging stay sane. Minify at the end of the pipeline, as the last step before deployment, and keep the formatted original as your source of truth. This tool fits that flow perfectly: paste the final stylesheet, minify, ship — then next change starts from the formatted version again.
What is the difference between minifying and using CSS variables or shorter class names?+
Different tools for different wins. Minification removes *syntax* overhead — safe, automatic, no trade-offs. Shortening class names or restructuring CSS changes *content* — bigger potential savings, but requires build-tool insight into your HTML and risks collisions. Utilities like Tailwind produce small class names by design and still benefit from minification of the framework layer. Start with minification — it is free of risk and requires nothing but this page.