⚡
usefultools.dev
CSS

CSS Minifier

NOUVEAU

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

Fonctionne à 100 % dans votre navigateur — vos données ne sont jamais envoyées ni stockées sur nos serveurs.

Cet outil n'est pas encore entièrement traduit : une partie du texte est encore en anglais. L'outil lui-même fonctionne de la même façon dans toutes les langues.

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.

⚡

Exemples rapides

Des entrées typiques et les résultats produits par cet outil.

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}
📖

Présentation

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.

Pourquoi utiliser cet outil ?

  • 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
⭐

Fonctionnalités

🗜️

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.

🛠️

Mode d'emploi

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.

🤔

Questions fréquentes