What CSS minification removes
CSS minification removes everything the browser doesn't need to interpret the stylesheet correctly. This includes all comments (/* ... */), all whitespace between declarations and rules, unnecessary semicolons before closing braces, and can also shorten color values (#ffffff → #fff) and zero units (0px → 0).
A typical unminified CSS file with comments, blank lines, and consistent indentation might be 30–50% larger than its minified equivalent. For a 100KB CSS file that's a saving of 30–50KB. Combined with gzip compression on the server, minified CSS transfers even faster.
The structure and logic of the CSS is unchanged. Every rule, selector, and value is preserved — just without the surrounding whitespace.
- Removes comments
- Removes whitespace, newlines, and tabs
- Removes trailing semicolons before }
- Shortens hex colors (#ffffff → #fff)
- Removes unnecessary zeros (0px → 0, 0.5 → .5)
- Merges duplicate selectors where safe
How to minify CSS with the online tool
The Irreva CSS Minifier is a straightforward browser-based tool. Paste your CSS into the input area and the minified output appears immediately. Click copy to use it in your project.
The tool handles standard CSS as well as CSS with vendor prefixes (-webkit-, -moz-, etc.) and modern features like CSS variables, calc(), and @media queries. It doesn't rewrite your CSS — it only removes whitespace and comments.
For production use, integrate CSS minification into your build pipeline using a tool like PostCSS with cssnano, or use the built-in CSS minification in webpack, Vite, or Parcel. The online tool is useful for quick checks, one-off files, or when you don't have a build system.
Minification vs compression — what's the difference
Minification removes characters that are unnecessary for functionality. Compression (like gzip or Brotli) is applied by the web server to compress the remaining bytes for transfer. These two optimizations work at different layers and compound each other.
A file that is minified first and then gzip-compressed is smaller than either optimization applied alone. The reason: minification makes the file more repetitive at the character level, which compression algorithms exploit very effectively.
Most web servers (Nginx, Apache, Cloudflare) serve CSS with gzip or Brotli automatically. Minifying the CSS before deployment is still worthwhile — it reduces the uncompressed size cached on the client and speeds up decompression.
