Vai al contenuto principale
Tools Star Hub

Minificatore CSS

Minifica CSS nel browser preservando stringhe, URL, commenti e spazi importanti.

Caricamento dello strumento…

Questo strumento funziona nel tuo browser. Dati inseriti, file e valori generati restano su questo dispositivo. Preferiti e strumenti recenti, se li usi, salvano solo i nomi degli strumenti nella memoria locale: mai password, documenti o contenuti dei codici QR. Consulta l’informativa sulla privacy.

Per ora la guida dettagliata di questo strumento (come si usa, esempi e domande frequenti) è disponibile in inglese.

What this tool does

Drop CSS comments and spare spaces between tokens. Front-end work that ships a stylesheet can use it for a shorter file before a build step. Selectors are not merged, spaces inside strings and calc() stay, and vendor prefixes are not added.

How to use

  1. Paste CSS into the left box.
  2. Press Minify to remove comments and unnecessary whitespace.
  3. Compare the before/after counts, then copy or clear.

Examples

  • Rules and comments

    /* note */ .hero { color: #2563eb; } becomes .hero{color:#2563eb;}

  • url() and strings

    Spaces inside quoted strings and url() values are kept. calc() and custom properties keep the spaces they need.

How it works

The CSS minifier walks the source as tokens rather than applying a single naive regex. It removes comments, then drops whitespace that is not required between identifiers, braces and operators. Strings, data URLs and escaped characters stay intact. It is conservative: it will not perform advanced optimizations such as merging selectors.

Limitations

Comments are deleted and spare spaces between tokens are dropped. Spaces inside strings, url() values, and calc() stay. Selectors are not merged, and vendor prefixes are not added. A stylesheet longer than 400,000 characters is refused.

See the disclaimer for what these tools do not cover.

FAQ

Is the CSS Minifier free?
Yes. You can minify a stylesheet in this browser without paying or creating an account.
Can this break my stylesheet?
Unusual hacks or files that are not CSS can still fail. Valid everyday stylesheets should minify cleanly. Review the output if you rely on exotic syntax.
Is my input sent to a server?
No. The CSS stays in this tab while it is minified. It is not sent to a server or saved in local storage.
Why minify CSS?
A smaller stylesheet downloads faster. Minifying removes comments and spare whitespace without changing what the rules do.
Can I un-minify CSS later?
You can reformat it, but removed comments are gone. Keep your original, readable file and publish the minified copy.