Skip to content
Tesserae

Keyboard shortcuts

Focus search
/
This help dialog
?
Run the current tool
Ctrl/⌘ +Enter
Copy the output (when an output is focused)
Ctrl/⌘ +C

Shortcuts are ignored while you are typing in an input, a textarea or a select.

Web & CSS

CSS Minifier

Compress a stylesheet by removing comments, collapsing runs of whitespace, trimming space around selectors and declaration separators, dropping the final semicolon in each block and deleting empty rules. Strings, url() contents, calc() arithmetic spacing and @media conditions are preserved correctly, so the output stays valid. Runs fully on-device and reports the byte savings.

On-device No network Offline-ready

🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.

Try:

Options

Your result will appear here

Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.

How it works

What the CSS Minifier removes

Paste a stylesheet and the tool strips comments, collapses runs of whitespace, trims space around selectors, braces and declaration separators, drops the final semicolon in each block, and deletes rules that end up empty. The result is the same CSS with fewer bytes, and the report tells you how much smaller it got.

Trimming a stylesheet for shipping

Use it on hand-written or exported CSS just before you paste it into a template or inline it in a style element. Because the transformation only touches whitespace and comments, the styling is byte-for-byte equivalent, so you can minify a production rule set without a build step or a risk of changed behaviour.

The two switches

Keep license comments leaves the /*! banner comments that tools and licences use, and turning it off strips those as well. Remove empty rules deletes blocks with nothing inside after minifying; switch it off if you keep them as deliberate placeholders.

What is deliberately left alone

It never renames selectors, merges rules or rewrites values, so the output stays predictable. Spaces are preserved inside strings and url() contents, between two identifiers, and around plus and minus inside calc and the other maths functions where CSS requires them. Inputs beyond two megabytes are rejected.

Your stylesheet is not uploaded

Minification happens in the page. Nothing is sent anywhere and the tool works offline, so a stylesheet that names internal components or carries licence text stays on your machine.

Questions

Will the minified CSS still be valid?

Yes. Whitespace is only removed where CSS allows it: never inside strings or url() contents, never between two identifiers, and always kept around + and - inside calc(), min(), max() and clamp(), where CSS requires it.

What happens to comments?

Normal comments are removed. Comments that start with /*! — the convention for licenses and banners — are kept by default; turn off "Keep /*! license comments" to drop them too.

Are empty rules really removed?

Yes, rules whose body is empty after minification are deleted, including nested ones and empty at-rule blocks. Disable "Remove empty rules" if you rely on them as placeholders.

Does it rename or merge selectors?

No. It is a safe, lossless whitespace and comment minifier: selectors, properties, values and their order are left exactly as written.

See category