Zum Hauptinhalt springen
Tools Star Hub

CSS-Minifier

CSS im Browser minifizieren; Strings, URLs, Kommentare und wichtige Leerzeichen bleiben erhalten.

Tool wird geladen …

Dieses Tool läuft in Ihrem Browser. Eingaben, Dateien und erzeugte Werte bleiben auf diesem Gerät. Favoriten und zuletzt verwendete Tools speichern – falls Sie sie nutzen – nur Tool-Namen im lokalen Speicher, niemals Passwörter, Dokumente oder QR-Inhalte. Mehr dazu in der Datenschutzerklärung.

Die ausführliche Anleitung zu diesem Tool (Bedienung, Beispiele und FAQ) ist vorerst nur auf Englisch verfügbar.

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.