CSS Beautifier
Reformat CSS with consistent indentation and spacing.
Compress your CSS by removing spaces, line breaks and comments and shortening values, so your stylesheets load faster without changing how your site looks.
Paste or type to begin. Everything runs in your browser.
How it works
Paste CSS, drop a .css file onto the input, or load the sample.
Comments, whitespace and redundant values are removed. Turn on restructuring to also merge duplicate rules.
Check the size saving under the editor, then copy or download the minified CSS.
About this tool
CSS is render-blocking: the browser won't paint the page until it has downloaded and parsed your stylesheets. Smaller CSS files download faster, which improves page load time, user experience and Core Web Vitals, and can contribute to better search rankings.
This minifier is powered by CSSO. It removes whitespace and comments, shortens colours (#ffffff becomes #fff), drops redundant units and zeros, and can optionally restructure your stylesheet by merging duplicate selectors and declarations for even bigger savings, all while keeping the CSS functionally identical.
Goes beyond removing spaces: shortens colours, numbers and shorthand values.
Merge duplicate rules and declarations for extra savings.
Preserve /*! … */ comments that licenses require.
Before and after sizes and the percentage saved are shown instantly.
FAQ
Yes. Minification only removes characters that browsers ignore and rewrites values in equivalent shorter forms. Restructuring is also safe in most cases, but test the result if you rely heavily on rule order.
Typically 15–40% before gzip, depending on how many comments and how much whitespace the original has.
Yes. Minification and server compression work together, and you'll get the smallest transfer size by using both.
No. This tool runs entirely in your browser using JavaScript. Your files and text never leave your device, so it's safe for private or confidential work.
Missing something?
Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.