Code Minifiers

CSS Minifier

Minify CSS with support for selectors, strings, calc(), and custom properties, and compare file sizes and savings.

Press Ctrl / ⌘ + Enter to run
Read-only result

Minify CSS with support for selectors, strings, calc(), and custom properties, and compare file sizes and savings.

What this tool does

CSS Minifier removes unnecessary whitespace and ordinary comments and shortens eligible style declarations. Strings, selectors, and functions follow CSS syntax; check the result on your target page after minifying.

  • /*! comments in the license form are retained.
  • Supports modern selectors, media queries, calc() and custom attributes.
  • Parsing errors are displayed, old error results are not output.

How to use it

  1. Paste the CSS.
  2. Click "Compress CSS."
  3. View compression results and savings ratio.
  4. Copy or download minified.css and perform visual regression testing.

Common uses

  • Optimize the size of the production environment style sheet.
  • Remove meaningless whitespace and plain comments.
  • Consolidate declarations and values that are safe to optimize.

CSS Minifier Features

Minify CSS while preserving strings, calc() expressions, and custom properties. Review the result, then copy it for use.

FAQ

What does minification optimize?

It cleans up redundancy, shortens values that can be expressed in shorter forms, and restructures some declarations under safety rules.

Will custom attributes be preserved?

Common CSS custom properties are preserved. For complex styles, check the minified result in your target browsers.

Why keep /*! comments?

These comments often contain license or copyright information, so they are preserved in the minified output.

Back to Developer Tools