CSS Minifier

Shrink your stylesheets by removing comments and unnecessary whitespace — free and instant. Everything runs in your browser, so your CSS is never uploaded to a server.

How to use the CSS Minifier

  1. Paste your CSS. Drop a stylesheet, a component's styles or any block of CSS into the box above.
  2. Choose your options. Leave Keep license comments on if you want to preserve special /*! … */ banner comments, then press Minify CSS.
  3. Copy or download. Grab the compressed CSS with the copy button, or download it as a .min.css file. The size panel shows exactly how much you saved.

About this tool

This free online CSS minifier compresses stylesheets so pages load faster and use less bandwidth. It removes every comment, collapses runs of spaces and line breaks, strips the whitespace around braces, colons, semicolons and commas, and deletes the redundant final semicolon before each closing brace. The result is byte-for-byte equivalent CSS that renders identically but is significantly smaller — often 30–60% lighter than hand-formatted source.

The minifier is written to be safe: it parses your CSS character by character so that content inside strings and url() values is never touched, and it deliberately keeps the spaces inside calc() expressions like calc(100% - 20px), which browsers require. Everything happens locally in your browser using client-side JavaScript, so your stylesheets are never uploaded, logged or stored, and the tool keeps working even offline once the page has loaded.

Frequently asked questions

Does minifying change how my CSS looks in the browser?

No. Minification only removes characters that the browser ignores anyway — comments and whitespace. The selectors, properties and values are untouched, so the rendered result is identical to your original stylesheet, just delivered in fewer bytes.

Is my CSS uploaded anywhere?

No. All processing runs inside your browser with JavaScript. Nothing you paste leaves your device, which makes the tool safe for proprietary or unreleased stylesheets, and it even works with no internet connection once the page is loaded.

Will it break calc() or important comments?

No. The tool keeps the mandatory spaces around + and - inside calc(), and when the option is enabled it preserves special /*! … */ comments that are often used for license banners. Regular comments are removed.

How much smaller will my file get?

It depends on how heavily commented and indented your source is. Well-commented, nicely formatted CSS often shrinks by 40% or more; already-compact CSS shrinks less. The size panel reports the exact original size, minified size and percentage saved for your specific input.