Skip to content

CSS Minifier

Compress your CSS by stripping comments, whitespace, and redundant characters

0 characters

Ship Smaller Stylesheets to Production

Every byte in your CSS file is a byte the browser must download, parse, and apply before rendering the page. Comments, indentation, and extra whitespace make CSS readable for developers but serve no purpose in production. Minification strips these non-functional characters, producing a compact stylesheet that loads faster, parses faster, and reduces bandwidth — especially important on mobile networks where every kilobyte counts.

What Gets Removed

The minifier strips block comments (/* ... */), collapses runs of whitespace into single spaces, removes whitespace around selectors and braces, drops trailing semicolons before closing braces, and removes unnecessary quotes from font names and URLs where safe. It preserves content inside strings and data URIs, and it keeps important comments (/*! ... */) that often contain license notices.

Performance Impact

CSS is a render-blocking resource — the browser will not paint a page until its CSS is fully downloaded and parsed. Reducing the file size directly improves First Contentful Paint and Largest Contentful Paint. On a 3G connection, shaving 10 KB off a stylesheet can save 100–200 ms of load time. Combined with gzip or Brotli compression on the server, minification provides the best possible payload size.

When to Use This Tool

This tool is ideal for quick, one-off minification: pasting a CSS file before uploading it to a CMS, compressing a third-party stylesheet, or testing how much space your comments and formatting consume. For automated workflows, build tools like PostCSS with cssnano, Lightning CSS, or esbuild handle minification as part of a pipeline with source maps and autoprefixing.

Minification vs. Optimization

Minification makes the same CSS smaller. Optimization rewrites CSS for better performance — merging duplicate rules, shortening color values (#ffffff to #fff), removing vendor prefixes that are no longer needed. This tool focuses on safe, lossless minification. For deeper optimization, tools like cssnano (level 2) and PurgeCSS go further but require more configuration.

Privacy

All processing runs in your browser. No CSS is uploaded to any server, so this is safe for proprietary stylesheets, internal design systems, and client projects.

$ faq

What does CSS minification do?
Minification removes characters that browsers don't need: comments, extra whitespace, newlines, trailing semicolons, and unnecessary quotes. The result is functionally identical CSS in fewer bytes, which means faster downloads and better page performance.
Is minified CSS harder to debug?
Yes — minified CSS is one long line and very hard to read. Keep your original source files for development and serve the minified version in production. Browser DevTools can also pretty-print minified CSS for inspection.
Does minification change how CSS works?
No. Minification only removes characters that have no effect on rendering. Selectors, properties, values, and their order remain exactly the same. The browser interprets minified CSS identically to the original.
How much smaller does CSS get?
Typical savings are 15–30% before gzip. Well-commented CSS with generous formatting can see 40% or more reduction. After gzip compression (which your server likely applies), the additional savings from minification are smaller but still worthwhile for initial parse time.
Does this remove unused CSS?
No. This is a minifier, not a tree-shaker. It compresses the CSS you give it but does not analyze your HTML to find unused rules. Tools like PurgeCSS or the Coverage tab in Chrome DevTools handle unused CSS removal.
Can I minify CSS with source maps?
This tool does not generate source maps. For production workflows with source map support, use build tools like PostCSS, cssnano, or esbuild. This tool is designed for quick one-off minification.
Is my CSS sent to a server?
No. All processing runs in client-side JavaScript. Nothing is uploaded or stored.