Developer Tools

CSS Minifier

Minify CSS by removing comments and extra whitespace safely. Strings, url() values and selectors stay intact. See the size saved, copy or download.

  • 100% free
  • No sign-up
  • Private: runs on your device
  • Updated

Enter your details

Runs in your browser. Nothing you enter is uploaded or saved.

Your result

Your converted output and its statistics appear here.

What is CSS Minifier?

CSS Minifier makes stylesheets smaller so pages load faster. It removes comments and whitespace that browsers ignore, while keeping strings, url() values, selectors and calc() expressions exactly as written. License comments that start with /*! can be kept.

Smaller stylesheets download faster, which helps Core Web Vitals scores on slow mobile connections. Minify a hand-written stylesheet before uploading it, or check how much a theme's CSS could shrink. Keep your readable original for editing and publish the minified copy.

How to use CSS Minifier

  1. Paste your CSS or open a .css file.
  2. Choose whether to keep /*! license */ comments.
  3. The minified CSS and the size saved appear as you type.
  4. Copy the result or download style.min.css.

Key features

  • Safe, string-aware minification
  • Keeps selectors like a :hover intact
  • Optional license-comment retention
  • Shows original and minified size
  • Download as style.min.css

Why use this css minifier

  • Faster page loads with smaller CSS
  • Safe: does not reorder or rewrite rules
  • See the exact bytes saved
  • Runs entirely in your browser

How it works

Tokenise strings and comments first, then drop whitespace only where CSS grammar ignores it.

CSS Minifier examples

1

Simple rule

Input: .card { padding : 16px ; }

Result: .card{padding:16px}

2

Comments removed

Input: /* Header */ h1 { margin: 0 }

Result: h1{margin:0}

Important notes before you rely on the result

  • Everything runs client-side, so it is safe to paste API responses, but avoid pasting live passwords or private keys into any website.
  • Base64 is an encoding, not encryption: anyone can decode it.
  • JSON is parsed, never executed. Comments and trailing commas are not valid JSON and are reported as errors.

Limits and supported formats

  • Removes comments and whitespace only; it does not merge rules, shorten colours or rename anything, so the output behaves exactly like the input.
  • Input up to 2 million characters.

Privacy and data handling

Runs in your browser. Nothing you enter is uploaded or saved.

CSS Minifier: frequently asked questions

Can minifying break my CSS?

This minifier only removes characters CSS ignores and keeps spaces that matter (for example in a :hover or calc(100% - 10px)). Still, test the result before deploying.

Should I keep license comments?

Keep them if you use third-party CSS whose license requires the notice, such as frameworks.