About css minifier / compressor
Minifying CSS removes comments and whitespace so the file downloads faster. The tool also shows how many bytes were saved.
Combine with compression
- Server compression with gzip or Brotli gives the biggest saving.
- Minification stacks on top of it for a smaller final size.
- Keep the original source file for editing.
A worked example
The rule .btn { color: #ffffff; background: #2449b8; } becomes .btn{color:#fff;background:#2449b8}. The tool also shows how many bytes were saved, which is usually 20 to 40 percent on hand-written CSS before server compression.
Tips
- Keep important license comments that start with /*! if your licence requires them.
- Test pages after minifying, since broken CSS may hide behind a missing semicolon.
- Combine and remove unused CSS to save more than minification alone.
Build tools
In real projects, minification usually runs automatically in the build, with tools such as cssnano or the bundler's built-in minifier. A manual tool is handy for quick checks and small snippets.
