Online CSS Minifier

Compress and minify CSS code instantly in your browser without sending data anywhere.

CSS Minifier

What Is It?

The CSS Minifier compresses your stylesheet by stripping whitespace, comments, and redundant characters — reducing file size without altering functionality. Smaller CSS means faster page loads, better Core Web Vitals scores, and reduced bandwidth costs, all processed locally in your browser.

How to Use

  1. Paste your CSS stylesheet into the input area.
  2. Click Minify to compress the code.
  3. The minified CSS appears in the output panel, ready to copy.
  4. Use the Copy button to place it directly in your clipboard.

Example

Input:

/* Button styles */
.button {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background-color: #3b82f6;
  color: #ffffff;
  border-radius: 6px;
}

Output:

.button{display:inline-flex;align-items:center;padding:8px 16px;background-color:#3b82f6;color:#fff;border-radius:6px}

Benefits

  • Reduces file size — typically 20–40% smaller, directly improving load times.
  • Improves Lighthouse scores — minified CSS is a standard recommendation in Google Lighthouse audits.
  • Strips comments — removes developer notes that end users never need.
  • Fully private — your stylesheets stay in your browser, never transmitted anywhere.

Common Use Cases

  • Minifying stylesheets before deploying to production.
  • Compressing third-party CSS you’re embedding in a project.
  • Preparing CSS for a CDN upload where every byte counts.
  • Reducing payload size in single-file HTML documents.
  • Checking how small a stylesheet can get before build tools are set up.

Frequently Asked Questions

Will minification change how my CSS behaves?

No. Minification only removes characters that browsers ignore (whitespace, comments, newlines). The visual and functional output of your styles remains identical.

Does it optimise shorthand properties?

Basic shorthand consolidation (e.g., #ffffff#fff) is applied where safe. Full property-level optimization is outside the scope of this tool.

Can I minify multiple CSS files at once?

Currently, one input at a time is supported. You can concatenate your files before pasting for a single minification pass.

Is there a file size limit?

No hard limit is enforced. Very large files (>1MB) may take slightly longer to process but will complete without errors.

Should I minify CSS myself or let a build tool handle it?

For production projects, build tools (Vite, Webpack, etc.) handle minification automatically. This tool is ideal for quick one-off compressions, snippets, and projects without a build pipeline.