CSS Minifier

Paste your CSS below and get a minified version instantly. Comments, whitespace, and redundant declarations are removed client-side — your code never leaves your browser.

Remove comments
Collapse whitespace
Remove zero units
Shorten colors
Input · CSS
Output · Minified
❤️ Support CodeConverter.net and donate ❤️

Why minify CSS?

What does CSS minification do?

CSS minification strips all characters from a stylesheet that are not required for it to function correctly — this includes whitespace, newlines, comments, and redundant semicolons. The browser doesn't care whether your CSS is beautifully formatted or a single long line; it renders the same either way. Minified CSS, however, downloads and parses noticeably faster.

Beyond simple whitespace removal, a smart CSS minifier can also shorten six-digit hex colors to their three-character equivalents (e.g. #ffffff#fff), collapse 0px to 0, merge equivalent selectors, and remove duplicate properties. On large projects these micro-optimisations add up quickly — savings of 20–40% are common.

Faster render times
  • Smaller stylesheets download faster over the network
  • Reduced render-blocking time on first paint
  • Better Largest Contentful Paint (LCP) score
  • Improved Core Web Vitals & SEO rankings
100% private & client-side
  • All processing happens inside your browser
  • Zero data transmitted to any server
  • Safe for confidential or proprietary stylesheets
  • Works offline — no internet required after load
How to use this tool
  • Paste your CSS or click Upload to load a file
  • Toggle options (comments, whitespace, colors, units)
  • Click Minify CSS to process
  • Copy the result or download as .min.css
What gets removed?
  • Block comments (/* … */)
  • Unnecessary spaces, tabs, and newlines
  • 0px0, #ffffff#fff
  • Trailing semicolons before closing braces
CSS variables & minification
  • Custom properties like --color-primary are preserved as-is
  • CSS variable names are not renamed or shortened
  • :root blocks and variable declarations remain intact
  • Safe to minify design token stylesheets
Minification & source maps
  • Source maps link minified CSS back to original source
  • DevTools can show original line numbers with a source map
  • For source map support, use a build tool like PostCSS or Vite
  • This tool is ideal for quick one-off minification tasks

Should I minify CSS in production?

Absolutely. Serving unminified CSS in production is unnecessary overhead — the browser gains nothing from the extra whitespace. For most projects the right workflow is: write readable source CSS (or SCSS/Less) → process through a build tool like Vite, webpack, or PostCSS → serve the minified output. Combined with gzip or Brotli compression, minified CSS files are typically 60–80% smaller than the original.

This tool is especially handy for quick one-off tasks: stripping a third-party stylesheet you can't change in your build pipeline, compressing a small snippet for an email template, or simply checking how much a file could be reduced before setting up a full build system.