Skip to content
iyziTool

CSS Minifier

Paste a stylesheet and get a compact version ready for production. The tool shows the size before and after.

Minified
Paste code to minify it.

About this tool

CSS minification goes beyond deleting whitespace. csso, the optimiser used here, also merges identical selectors, removes overridden declarations, shortens colours (#ffffff → #fff) and units (0px → 0), and reorders where it is provably safe. The result typically shrinks a hand-written stylesheet by 20–40% before gzip.

The minifier understands modern syntax including custom properties, nesting and container queries. Its structural optimisations are conservative and widely used in build pipelines, so the output renders identically. Keep the readable source and minify only for deployment.

Frequently asked questions

Is structural optimisation safe?
csso only merges or drops rules when the cascade result stays identical. It has been used in production build tools for years.
Why is the saving small?
Already compact CSS, or CSS with many unique selectors, has little to remove. Gzip on the server does the rest.
Can I keep certain comments?
Comments starting with /*! are preserved as licence banners.

Related tools