Paste your CSS and get a minified version with the comments and needless whitespace removed, plus a before/after byte count so you can see the saving. It runs entirely in your browser — nothing is uploaded — and it deliberately leaves the spacing inside calc() and strings alone so your styles keep working.
How it works
The minifier strips /* comments */, collapses runs of whitespace, and removes spaces around structural tokens like braces, semicolons, colons, commas and the child combinator. It also drops the redundant final semicolon before each closing brace. The result is byte-for-byte smaller CSS that renders identically.
It is conservative on purpose. Strings and url() values are protected before anything is stripped, so significant spaces inside them survive. Spaces around +, - and ~ are never touched, which keeps calc() expressions such as calc(100% - 20px) and sibling combinators intact. It does not rename classes, merge rules, or reorder properties — those need a full CSS parser and can introduce subtle bugs, so this tool sticks to safe, lossless size reduction.
Practical examples
A hand-written stylesheet
A 12 KB stylesheet full of comments and indentation drops to around 8–9 KB once whitespace and comments are gone — a typical 25–35% reduction with no visual change.
Copying a snippet into an inline style block
You need to paste some CSS into an email template or a <style> tag and want it compact. Minify it first so the markup stays small and tidy.
Checking what a rule really contains
Minifying collapses a sprawling rule onto one line, making it easy to eyeball every declaration at a glance before you commit it.
Frequently asked questions
Does minifying change how my styles look?
No. Only comments and unnecessary whitespace are removed. The declarations, selectors and values are untouched, so the rendered result is identical to the original CSS.
Will it break calc() expressions?
No. Spaces around +, - and ~ are deliberately preserved, so calc(100% - 20px) stays valid. Many naive minifiers get this wrong; this one leaves those operators alone.
Are the contents of strings and url() preserved?
Yes. Quoted strings and url() values are protected before whitespace is stripped, so significant spaces inside content: "…" or a url path are kept exactly.
How much smaller will my file get?
Usually 20–40% for hand-written CSS with comments and indentation. Already-compact or framework-generated CSS shrinks less. The before/after byte count shows the exact result for your input.
Does it rename classes or merge duplicate rules?
No. It only removes comments and whitespace. Renaming and rule-merging require fully parsing the CSS and understanding your markup, which risks breaking things, so they are out of scope here.
Can I minify SCSS or LESS?
Only after it is compiled to plain CSS. This tool works on CSS syntax; preprocessor features like variables, nesting and mixins must be compiled first.
Is the minified CSS reversible?
Not automatically — minifying discards comments and formatting, which cannot be recovered. Keep your original source; use a CSS formatter/beautifier if you need to make minified CSS readable again.
Does it handle media queries and keyframes?
Yes. Nested blocks like @media and @keyframes are minified the same way, since the tool works on the structural tokens rather than specific at-rules.
Is my CSS uploaded anywhere?
No. Minification runs entirely in your browser with JavaScript. Nothing is sent to a server, and it works offline once the page has loaded.
Related tools
HTML Minifier
Minify HTML in your browser — remove comments and collapse whitespace while protecting pre, script and style. Nothing is uploaded.
Developer tools
JSON Formatter
Beautify, validate or minify JSON in your browser — with clear error messages. Nothing is uploaded.
Developer tools
Color Converter
Convert colors between HEX, RGB and HSL, with alpha support and a live swatch. Runs in your browser.
Developer tools
Image Compressor
Compress JPG, PNG and WebP images in your browser — adjust quality, resize and convert with a live size comparison, no uploads.
Image tools
PX to REM Converter
Convert between px and rem for any root font size, with a quick reference table. For CSS work.
Developer tools
Resize Image
Resize JPG, PNG and WebP images to exact pixel dimensions in your browser — lock the aspect ratio or set width and height freely. Nothing is uploaded.
Image tools