CSS Minifier
Strips comments and needless whitespace from a stylesheet, safely.
Results
What this tool does
A stylesheet written to be read by people is full of things a browser does not need: comments explaining the intent, blank lines separating sections, spaces around every colon. Removing them typically takes a quarter to a third off the file, which arrives sooner and blocks rendering for less time. This is a conservative minifier — it removes only what is definitely spare, and never rewrites your rules.
Formula
strips comments and needless whitespace, leaving anything in quotes alone
Variables
| Symbol | Meaning | Unit |
|---|---|---|
text | CSS | — |
OUT | Minified | — |
SB | Size before | B |
SA | Size after | B |
SV | Bytes saved | B |
SP | Share saved | % |
Worked example
- CSS/* cores */ body { color : #17191f ; margin : 0 ; } a:hover { color : #d1490b }
- Minifiedbody{color:#17191f;margin:0}a:hover{color:#d1490b}
- Size before84 B
- Size after50 B
- Bytes saved34 B
- Share saved40.48 %
Limitations
- The calculation runs entirely in your browser. The values you type are never sent to a server.
Frequently asked questions
Does it touch the content of strings?
No. The minifier reads the stylesheet character by character and knows when it is inside quotes, so a content rule that deliberately contains spaces or a semicolon comes through untouched. Font names with spaces, background images with awkward filenames and attribute selectors all survive. What it does not do is rename anything, merge rules or reorder declarations — the output is the same stylesheet with the same meaning, only shorter.