← All tools
// CSS

CSS Minifier online

Minify CSS to reduce file size, or beautify CSS for editing

CSS Minifier logo
by
CHUNKY
MUNSTER
// Input CSS
0
Input bytes
0
Output bytes
Saved
// Output
Output will appear here...

How to Use css-minifier

  1. Paste your CSS code into the input area.
  2. Click Minify to strip whitespace, comments, and redundant characters.
  3. Switch to Beautify mode to format and indent compressed CSS for editing.
  4. Copy the output or download it as a .css file.

CSS minification removes whitespace, comments, and redundant characters from a stylesheet without changing how browsers parse or apply the rules. A stylesheet that is 50 KB before minification often compresses to 35–40 KB — reducing page load time, especially on mobile connections and CDN-cached assets.

What CSS Minification Removes

Minification strips: all whitespace (spaces, tabs, newlines) not required by CSS syntax; comments (/* ... */); leading zeros in decimals (0.5.5); unnecessary units on zero values (0px0); duplicate semicolons; and unnecessary quotes around property values. The resulting CSS is functionally identical but uses fewer bytes. Combined with gzip compression, minified CSS can reduce to 10–20% of its original size.

Frequently Asked Questions

Does CSS minification change how styles are applied?

No — minification only removes characters that the CSS parser ignores anyway. The resulting stylesheet is semantically identical and produces exactly the same visual rendering.

Should I minify in development or only in production?

Minify only for production. Minified CSS is hard to debug because source-mapped line numbers are collapsed. Most build tools (Webpack, Vite, Parcel) minify CSS automatically during production builds.

What about CSS source maps?

Production CSS should be accompanied by a .css.map file linking minified positions back to original source locations. Browser DevTools use the source map to show the original, readable CSS during debugging even though the browser parses the minified version.

How much smaller is minified CSS compared to the original?

Typically 20–35% smaller before server compression. With gzip or Brotli compression (which nearly all servers apply), CSS compresses extremely well — the difference between minified and non-minified becomes much smaller after server compression.

See also the CSS Prettifier, HTML Formatter, and JSON Formatter.