⚡
usefultools.dev
CSS

CSS Minifier

NEW

Minify CSS with csso: remove whitespace and comments, merge rules, and see the size saved before you copy it.

Runs 100% in your browser — your input is never uploaded or stored on our servers.

529 B

@import rules and url() references are never fetched or inlined, only tidied. An @import placed after other rules is invalid CSS and is dropped by the minifier, so keep imports at the top.

⚡

Quick Examples

Typical inputs and the results this tool produces.

Whitespace
.btn { color: #ff0000; margin: 0px; }
.btn{color:red;margin:0}
Merge
a { color: red; } b { color: red; }
a,b{color:red}
Shorten
.a { background: rgba(255, 255, 255, 1.0); width: 0.50em; }
.a{background:#fff;width:.5em}
Comments
/*! MIT */ /* note */ p { margin: 0 }
/*! MIT */ p{margin:0}
Values
a { font-weight: bold; color: #AABBCC }
a{font-weight:700;color:#abc}
📖

Overview

This CSS minifier compresses stylesheets with csso. It strips whitespace and comments, shortens colors and numbers, and merges duplicate selectors and declarations, so the file is smaller and loads faster without changing how the page looks.

Front-end developers use it to shrink a stylesheet or a snippet before deploying, or to check how much a CSS minify step would save. Decide whether to restructure rules, and keep legal /*! comments, only the first one, or none. Parse problems are listed with their line and column.

Processing happens entirely in your browser. Nothing is uploaded, and you get the original and minified size, percent saved and a gzip estimate as soon as it finishes.

Why use this tool?

  • Smaller CSS with csso structural optimization
  • Keep license comments or remove them all
  • Shows size, gzip and rule count savings
  • Reports invalid CSS with line and column
  • Private: styles never leave your browser
⭐

Features

🗜️

Whitespace and comments

Removes spaces, line breaks and comments while keeping the styles identical.

🔀

Rule restructuring

Merges duplicate selectors and declarations, with an option to turn it off.

©️

Legal comments

Keep every /*! comment, only the first, or remove all comments.

🎨

Shorter values

Turns #ff0000 into red, 0px into 0 and 0.50em into .5em.

📊

Size report

Original and minified bytes, percent saved, gzip estimate and rule and declaration counts.

📂

Upload and download

Drop a .css file in, then copy the result or download it as .min.css.

🛠️

How to Use

1

Add your CSS

Paste a stylesheet into the CSS input box, drop a .css file onto it, or press Sample.

2

Choose options

Keep Restructure rules ticked for the smallest output and pick how Comments are handled.

3

Minify

Press Minify, or leave Minify as I type on. Review the size saved and any parse issues.

4

Copy or download

Press Copy or Download .min.css and use it in production.

🤔

Frequently Asked Questions