⚑ Free CSS Minifier

CSS Minifier

Compress your CSS by removing comments, whitespace and the last semicolon in each rule β€” making stylesheets smaller and pages faster. Paste your CSS, choose your options and copy the minified result. 100% in your browser β€” nothing is uploaded or stored.

Input CSS
Minified Output

πŸ”’ Everything runs in your browser. Your input is never uploaded, logged or stored.

The CSS Minifier compresses your stylesheets by removing comments, collapsing whitespace, trimming unnecessary semicolons and optionally shortening zero values β€” all without changing how your styles render. Smaller CSS files download and parse faster, which improves page speed and Core Web Vitals, both of which support better user experience and search performance.

It is part of the Performance & Code Tools group in our free SEO Toolkit, alongside the HTML Minifier and JavaScript Minifier. To make minified CSS readable again, use the Code Beautifier, pull out above-the-fold rules with the Critical CSS Extractor, and estimate total weight with the Page Size Calculator. Everything runs in your browser β€” your input is never uploaded or stored.

⚑
Instant
100%
Free Forever
0
Data Stored
99.9%
Uptime
β€” Features β€”

Smaller Stylesheets, Faster Pages

Minify CSS safely with control over each step.

Strip Comments

Removes CSS comments that are only useful to developers.

Collapse Whitespace

Removes spaces around braces, colons, semicolons and commas.

Shorten Values

Optionally turns 0px into 0 and 0.5 into .5 to save bytes.

Live Savings

See the byte size before and after, with the percentage saved.

β€” How It Works β€”

Minify in Three Steps

Paste, choose options, copy the smaller file.

1

Paste CSS

Drop in a rule, a component or a whole stylesheet.

2

Pick Options

Choose what to remove and shorten.

3

See Savings

Compare original and minified sizes.

4

Copy or Download

Use the minified CSS on your site.

β€” Example β€”

Before and After

The same rule, minified.

Before
.card {
  margin: 0px;
  padding: 0.5rem 1rem;
}
After
.card{margin:0;padding:.5rem 1rem}

What Is CSS Minification?

CSS minification removes characters from a stylesheet that the browser does not need in order to apply the styles β€” comments, indentation, line breaks and unnecessary spaces and semicolons. The result is a smaller file that produces exactly the same visual output but downloads and parses faster. It is one of the simplest, safest ways to improve front-end performance. This tool minifies your CSS for you. It is part of the Performance & Code Tools group.

What Gets Removed

ItemWhy It's Safe to Remove
CommentsDeveloper notes the browser ignores
WhitespaceIndentation and spaces around braces and colons
Trailing semicolonsThe last semicolon before a closing brace is optional
Zero units0px and similar can safely become 0 (optional)

Why Minify CSS?

⚑

Faster Render

CSS blocks rendering, so a smaller file paints the page sooner.

πŸ“Š

Better Vitals

Lighter stylesheets help your Core Web Vitals scores.

πŸ“‰

Less Bandwidth

Fewer bytes served reduces data and hosting costs.

πŸ“±

Mobile Wins

Savings matter most on slower mobile connections.

What This Minifier Does

  • Removes CSS comments
  • Collapses whitespace and tidies spacing around braces and colons
  • Trims the optional last semicolon in each rule
  • Optionally shortens zero units and leading-zero decimals
  • Preserves the contents of quoted strings and url() values
  • Shows the byte sizes and percentage saved, with copy and download

How to Use the CSS Minifier

  1. Paste your CSSEnter a rule or a full stylesheet.
  2. Choose your optionsDecide what to remove and shorten.
  3. Review the savingsCheck the size comparison.
  4. Copy or downloadUse the minified CSS on your site.

Technical Notes

No. The tool removes only characters that do not affect how the browser applies your styles, and it protects the contents of quoted strings and url() values, where spacing can matter. The rendered result is identical. As with any build step, test the output before deploying to production.

Turning 0px into 0 is safe because a zero length is the same regardless of unit. This option is off by default so you stay in control, since a few rare properties expect a unit. For ordinary layout and spacing values, shortening zeros is a reliable, common optimisation.

This tool is perfect for one-off files, snippets and learning. For a live site, minify automatically through your build process or a caching and optimisation plugin, so every change is minified without manual steps. Use this tool to understand the savings and handle ad hoc stylesheets.

No. Minification runs locally in your browser with JavaScript. Nothing you paste is uploaded, logged or stored, so the tool is safe for proprietary stylesheets, design systems and confidential client work.

Common Use Cases

⚑

Speed Optimisation

Trim stylesheet weight to improve load times.

🎨

Design Systems

Minify component and utility CSS before shipping.

πŸ’»

Development

Compress hand-written CSS for production.

πŸ“¦

Embeds

Compact CSS bundled with widgets and embeds.

Use the CSS Minifier with these tools from the SEO Toolkit: compress markup with the HTML Minifier, shrink scripts with the JavaScript Minifier, reformat minified code with the Code Beautifier, extract above-the-fold CSS with the Critical CSS Extractor, estimate weight with the Page Size Calculator, and build head tags with the Meta Tag Generator.

β€” Who It's For β€”

Built for Everyone

Anyone who wants lighter, faster stylesheets.

πŸ’» Web Developers 🎨 Front-End Designers πŸ“ˆ SEO Specialists ⚑ Performance Engineers 🏒 Agencies πŸš€ Site Owners πŸ“§ Email Developers πŸŽ“ Students & Learners
β€” FAQ β€”

Frequently Asked Questions

Everything about minifying CSS.

It compresses your CSS by removing comments, collapsing whitespace, trimming the optional last semicolon in each rule and, if you choose, shortening zero values. You paste your stylesheet, pick your options and copy the smaller, minified output for use on your site.

Yes, completely. There is no cost, no sign-up and no limit on how much CSS you minify. The tool runs entirely in your browser, so there are no server costs and nothing to pay for.

No. Minification removes only characters that do not affect how the browser applies the styles, and it protects quoted strings and url() values. The rendered page looks identical. Always test the output before deploying if your CSS uses unusual patterns.

Yes. Minification happens locally in your browser with JavaScript. Nothing you paste is uploaded, logged or stored, which makes the tool safe for proprietary stylesheets, design systems and confidential client work.

It depends on how much whitespace and how many comments your stylesheet contains. Heavily formatted, comment-rich CSS can shrink considerably, while already-compact files save less. The tool shows the exact before and after byte sizes and the percentage saved.

Content inside quotes, such as a value used with the content property, and the text inside url() can contain spaces or characters that matter. The minifier shields these from whitespace collapsing so it never alters something that affects how your styles work.

Yes, because a zero length is identical regardless of unit. This option is off by default so you remain in control, since a small number of properties expect a unit. For typical spacing and layout values, shortening zeros is a standard, safe optimisation.

The semicolon before a closing brace is optional in CSS, so removing it saves a byte per rule without changing behaviour. Across a large stylesheet with many rules, these small savings add up while keeping the CSS perfectly valid.

This tool is ideal for one-off files, snippets and learning. For a live site, automate minification in your build process or via an optimisation plugin so every change is minified consistently. Use this tool for ad hoc stylesheets and to see the savings.

Minification is not perfectly reversible, since comments and original formatting are gone, but you can reformat minified CSS into a clean, indented layout with the Code Beautifier. Keep your original source in version control as the source of truth.

Yes. The minifier is fully responsive, so you can compress CSS from a phone or tablet. Pasting your stylesheet, toggling options, viewing the savings and copying the output all work the same as on desktop.

Minify Your CSS Now

Strip comments and whitespace to make your stylesheets lighter and your pages faster in seconds β€” free, private and instant in your browser.

⚑ Open the Minifier ← All Performance Tools