CSS Minifier & Beautifier

    Compress or beautify your CSS code

    Instant Convert

    Minify or beautify with one click

    100% Private

    Runs entirely in your browser

    No Signup

    Free tool, no registration required

    CSS Minification: What Gets Removed and Why

    CSS minification is the process of removing all content from a stylesheet that the browser doesn't need to apply styles: whitespace, comments, newlines, and redundant semicolons. The visual result is identical to the original — every selector, property, and value is preserved exactly — but the file is substantially smaller. A typical stylesheet minifies to 60–80% of its original size, reducing the bytes the browser must download before it can render the page.

    Why Minify CSS?

    CSS is render-blocking: browsers won't paint the page until all stylesheets in the <head> have finished downloading and parsing. Smaller CSS files load and parse faster, directly improving First Contentful Paint (FCP) and Largest Contentful Paint (LCP) — two of Google's Core Web Vitals that affect search ranking. A 50 KB stylesheet minified to 35 KB saves 15 KB on every page load, which matters most for mobile users on slower connections. Production build tools (Vite, webpack, esbuild) minify CSS automatically; this tool is useful for one-off tasks and for understanding what gets stripped.

    What Gets Removed

    Comments (/* ... */) are always safe to remove because browsers ignore them. Whitespace — spaces, tabs, and newlines between selectors, properties, and values — is purely for human readability. The trailing semicolon in the last property of a rule block is optional in CSS, so it can be dropped. Some advanced minifiers also merge duplicate rules, collapse shorthand properties, and remove vendor prefixes that modern browsers no longer need.

    How to Use This Tool

    Paste your CSS into the input area and click Minify. The minified output appears on the right, along with the byte savings. Click Copy to grab the minified CSS, or Download to save it as a file. For production use, integrate a tool like cssnano or lightningcss into your build pipeline rather than minifying manually.

    Frequently Asked Questions