Code & web

CSS minifier

Shrink a stylesheet by removing comments, spaces and line breaks.

Embed this calculator on your website

Copy this code and paste it into your page (WordPress, Wix, Webflow, HTML…). It's free: please keep the link to HOD Calc.

How it works

Comments and unnecessary spaces are removed, colours shortened (#ffffff → #fff) and zero units dropped (0px → 0).

Results are for guidance only and do not replace professional advice.

Worked example

With the default values:

  • CSS/* Bouton principal */ · .btn { · color: #ffffff; · padding: 12px 20px; · margin:…

you get:

  • Saved43.3 % (120 → 68 characters)

Frequently asked questions

How does the “CSS minifier” tool work?

Comments and unnecessary spaces are removed, colours shortened (#ffffff → #fff) and zero units dropped (0px → 0).

What do I need to enter?

Just fill in: css. The result updates as you type.

Can you give an example?

CSS: /* Bouton principal */ · .btn { · color: #ffffff; · padding: 12px 20px; · margin:… → Saved: 43.3 % (120 → 68 characters).

Is this calculator free, and is my data private?

Yes. HOD Calc is completely free with no sign-up. The calculation runs in your browser: nothing you type is sent or stored.