JS Tools

Online CSS Minifier & Compressor

Minify CSS stylesheets to reduce size; strips comments and redundant whitespace safely.

Loading tool...

How to use

  1. Paste or type your input in the left editor
  2. Adjust options in the toolbar if available
  3. Copy or download the output from the right pane

This free online tool runs entirely in your browser. No sign‑up, no server uploads.

About CSS Minify

Minify CSS stylesheets to reduce size; strips comments and redundant whitespace safely.

The CSS minifier parses the stylesheet and removes all insignificant whitespace — spaces around selectors, after colons, before braces, and between rules. Comments are stripped entirely. Additional optimizations include removing the last semicolon in each declaration block, collapsing shorthand color values (#ffffff to #fff), stripping units from zero values, and removing redundant whitespace within function calls like calc() and rgb(). The output is the smallest valid CSS representation.

Use the left editor to enter your data. The output updates in real time. You can copy, clear, download, or expand either pane.

Tip: Use the search bar to quickly switch between tools.

Why this tool?

FeatureCSS MinifyTypical alternatives
Free online toolYesOften yes
Client‑side only (privacy)YesVaries
No sign‑up requiredYesVaries

Explore related tools

Looking for more? Browse All tools or check categories like BeautifierMinifier, and Validators.

Related tools

FAQs

How much file size reduction does CSS minification achieve?
Minifying CSS for production typically reduces file size by 20-50%, depending on the amount of whitespace, comments, and verbose syntax in the original. Stylesheets with extensive comments and generous formatting see the largest gains.
Does CSS minification remove comments?
Yes. All CSS comments (/* */) are removed during minification since they are not needed in production. This alone can account for a significant portion of the file size reduction in well-documented stylesheets.
Will minification break my CSS animations or media queries?
No. The minifier only removes insignificant whitespace and comments. All selectors, properties, values, @keyframes, @media queries, and other CSS structures are preserved exactly. The stylesheet functions identically after minification.
Does the minifier shorten color values or combine properties?
The minifier focuses on safe transformations: removing whitespace, stripping comments, and eliminating unnecessary semicolons. It converts color values like #ffffff to #fff where possible and removes units from zero values (0px to 0) for additional savings.
Can I minify CSS with source maps?
The browser-based minifier produces the compressed output without source maps. For production builds requiring source maps, use a build tool like PostCSS, cssnano, or your bundler's built-in CSS minification with source map support.
Should I minify CSS before or after combining multiple files?
Ideally, combine your CSS files first and then minify the result. This produces a single minified file, which is optimal for HTTP performance. The minifier handles any size of concatenated CSS input.