CSS Compressor

Shrink CSS File Size by Removing Whitespace

Need to use CSS Compressor right now?

"Compress" and "minify" mean the same thing here — this covers whichever term you searched.

No sign-upNo uploads 100% free

8452 characters (38% smaller)

.card{padding:16px;color:#333}.title{font-size:20px}

Features

  • Runs entirely in your browser
  • Privacy-first — your data is never uploaded
  • Real-time, instant results
  • 100% free, no sign-up required
  • Works on desktop, tablet, and mobile
  • No installation needed

Who uses this tool?

Software engineersWeb developersAPI testersDevOps engineersStudents

About CSS Compressor

Well-formatted CSS with comments and consistent indentation is great for maintaining a stylesheet, but every one of those bytes gets downloaded by every visitor on every page load. This tool strips comments and collapses unnecessary whitespace around selectors, braces, colons, and semicolons, shrinking the file without changing any actual styling behavior.

The minifier removes CSS comments entirely, tightens spacing around punctuation (`{`, `}`, `:`, `;`, `,`) down to the minimum needed, and removes the final semicolon before a closing brace where it's redundant. These are purely textual transformations that preserve the exact same computed styles.

This is a lightweight, safe minifier — it doesn't merge duplicate selectors, shorten color values, or perform other more aggressive optimizations a build-tool-level minifier like cssnano would. For quick manual minification of a stylesheet before deployment, it still delivers a meaningful size reduction with zero risk to how your styles render.

How it works

  1. Paste your CSS. Any formatted stylesheet.
  2. Comments and whitespace strip automatically. See the size reduction percentage live.
  3. Copy the minified result. Ready to deploy as a smaller stylesheet.

Examples

Minifying a formatted stylesheet

Input

.card {\n  padding: 16px;\n  color: #333;\n}

Output

.card{padding:16px;color:#333}

Frequently asked questions