> codebench_TOOL: HomeLOCAL-ONLY⌘K Switch

CSS Minify

Tool guide

Minify CSS code

Input: This tool processes input in your browser. Check in Network (opens in a new tab)

Level:
Input (CSS)
Output (Minified)
Paste CSS code, then press ⌘Enter to minify

Minify your CSS with safe or aggressive optimization levels. Optionally keep license comments. See before/after file size comparison with reduction percentage. 100% client-side processing.

How to use it

  1. Paste the stylesheet into Input (CSS) and select Safe under Level to switch off rule restructuring.
  2. Leave Keep License checked and click Run. Compare the first comment and the two declarations in Output (Minified).
  3. Check the original and minified CSS against the same page states before replacing a stylesheet. Copy or download the minified result only after that comparison.

Worked example

Example input
/*! Demo theme */
/* base color */
.notice {
  margin: 0px;
  color: #ffffff;
}
Example output
/*! Demo theme */
.notice{margin:0;color:#fff}

The ordinary comment is gone. The zero margin no longer needs a unit, and #fff is shorthand for the same white as #ffffff. Safe still performs these declaration-level optimizations.

What to watch for

Keep License keeps only the first /*! … */ comment, not every notice. If you concatenate several stylesheets, check what must be retained before shipping.

Frequently asked question

Is the saved percentage a prediction of the download size?
No. It compares input and output text lengths before transfer compression. Use the delivered asset to measure gzip or Brotli savings.

Browse Minify tools

> codebench $Ctrl+Enter Run