Skip to main content
GARGLOO

CSS Minifier Online – Shrink CSS Free

Smaller CSS, same styles.

Runs on your deviceCSS

At a glance

Input:
CSS
Processing:
Runs locally in your browser
Privacy:
Nothing you type is sent to a server

Last updated: 2026-11-13

Common use cases

  • Shrinking a stylesheet before deploying it to production
  • Cleaning up a pasted snippet from a tutorial or a framework
  • Checking what minification actually removes, rule by rule
  • Keeping a license header while everything else gets minified

About this tool

A fast, private CSS minifier that strips comments and whitespace, shortens colors and drops zero units — with error messages that point at the exact offending character.

How to use it

  1. Paste CSS into the editor.
  2. Click Minify (⌘/Ctrl+Enter works too).
  3. Choose whether /*! important comments stay or go.
  4. Copy the result or download as .css.

Worked examples

Input: body { margin: 0px; color: #ffffff; }

Output: body{margin:0;color:#fff}

37 characters → 25 characters = 32.4% smaller — the headline example, verified.

Input: a{color:#ffffff;background:#336699}

Output: a{color:#fff;background:#369}

Hex colors shorten only when each pair doubles (#336699 → #369).

Input: @keyframes x{0%{opacity:0}100%{opacity:1}}

Output: @keyframes x{0%{opacity:0}100%{opacity:1}}

Keyframe selectors are never touched — the 0% stays 0%.

Practical tips

  • Use Ctrl/⌘+Enter to re-run after each fix — the shortcut keeps hands on the keyboard.
  • Keep /*! ... */ on if your stylesheet carries a license header — it survives minification.
  • Minify a copy, not your only copy: keep the readable source and ship the minified file.

Common mistakes

  • Minifying before debugging: read the formatted version first, minify only when size matters.
  • Pasting CSS with an unclosed brace — the error names the exact line and column of the '{'.
  • Expecting minification to fix broken CSS: it only shrinks valid stylesheets, it never repairs them.

How this compares

Most CSS minifiers in the field are server-side paste bins that upload your stylesheet. This one minifies locally with no upload, keeps /*! license comments when asked, and reports the exact line and column of the first error. The tradeoff: no formatting/beautifying mode and no Sass/Less support — for readable CSS, pair it with a formatter; for preprocessors, compile first.

Good to know

  • Valid CSS only — the minifier shrinks stylesheets, it never repairs broken ones.
  • Media-query parentheses are copied as written, so (max-width: 600px) keeps its space — valid, just a few bytes larger.
  • The 1,000,000-character cap keeps huge stylesheets responsive; split larger files before pasting.

Frequently asked questions

Does minifying send my CSS anywhere?

No. Minification runs entirely in your browser — safe even for stylesheets with internal hostnames or tokens in comments you'd rather not leak.

What exactly does it change?

It strips comments and whitespace, shortens #ffffff to #fff, drops the unit from zero lengths (0px → 0) and removes the last semicolon in each block. Selectors, strings, url() values and calc() spacing are never touched.

What happens to /*! important comments?

They are kept by default — license headers and similar notices survive minification. Switch to 'Remove all' if you want every comment gone.

How much smaller does CSS get?

Typically 15–40% on hand-written stylesheets. The sample on this page goes from 432 to 300 characters — 30.6% smaller — and already-minified CSS barely shrinks further, which is expected.

How large can input be?

Up to 1,000,000 characters. Unbalanced braces, unclosed strings and unclosed comments are reported with the exact line and column instead of producing a broken file.

All developer tools
CSS Minifier Online – Shrink CSS Free | GARGLOO