CSS Minifier
Minify CSS in one paste — comments stripped, whitespace collapsed, with exact byte savings shown.
About this tool
Minification strips everything from CSS that browsers ignore — comments, indentation, line breaks, redundant spaces, the final semicolon in each block — leaving byte-identical behavior in a smaller file. Smaller CSS means faster first paint, because stylesheets block rendering: the browser will not draw the page until the CSS arrives. Typical hand-written stylesheets shrink 20–40%.
Paste your CSS and the minified version appears instantly, alongside the numbers that make the result concrete: exact bytes before, bytes after, and percentage saved. One engineering detail separates this from regex-naive minifiers: string literals are protected before any transformation, so quoted values — content: " — ", url("my file.png"), font names with spaces — pass through untouched instead of getting their internal whitespace mangled. Comments starting with /*! (the license-comment convention) are preserved, as build tools expect.
Honest guidance on when to use it: for build pipelines, your bundler's minifier (which also does aggressive value-level optimization) is the right tool — this one is for everything else: the hand-edited stylesheet on a small site, CSS pasted into a CMS or theme customizer, an email template, a quick check of how much a file would shrink, or cleaning a snippet before embedding it. Your CSS never leaves the browser.
How to use the CSS Minifier
- 1Paste your CSS.
- 2Read the before/after sizes and the percentage saved.
- 3Copy the minified output.
- 4Keep the original as your editable source — minified CSS is for shipping, not editing.
Frequently asked questions
Does minification change how my CSS behaves?
No — only characters browsers ignore are removed: comments, whitespace and redundant semicolons. Selectors, properties and values are untouched, and quoted strings are explicitly protected, so the rendered result is pixel-identical.
How much smaller will my CSS get?
Typically 20–40% for hand-written CSS, depending on how heavily commented and indented it is. The exact figure appears in the before/after stats. Combined with the gzip compression your server already applies, stylesheet transfer size drops substantially.
Why did my /*! license comment survive?
By convention, comments beginning /*! are preservation-marked — licenses and attribution notices that must legally ship with the code. Every standard minifier honors the convention, and this one does too. Regular /* comments are removed.
Should I use this instead of my build tool's minifier?
No — in a build pipeline, tools like cssnano or Lighthouse-recommended bundler minification go further (shortening colors, merging rules). This tool is for CSS outside pipelines: CMS custom-CSS boxes, email templates, theme snippets, and quick size checks.
Related tools
CSS Gradient Generator
Design linear and radial gradients visually — with the exact CSS one click away.
Open toolBox-Shadow Generator
Design CSS box-shadows with sliders and a live preview — offsets, blur, spread, opacity and inset.
Open toolHEX / RGB / HSL Converter
Paste a color in any format — HEX, rgb() or hsl() — and get all three, instantly.
Open toolHTML Entities Encoder / Decoder
Escape text for safe HTML display, or decode &-riddled text back to readable characters.
Open tool