CSS Minifier
Strip comments, whitespace, and unnecessary characters from CSS to reduce file size.
How to use this tool
- 1
Paste your CSS — a single rule, a component stylesheet, or an entire file.
- 2
The minified result and the byte savings appear instantly below the input.
- 3
Copy the minified output, or compare the before/after byte count to see the reduction.
What is CSS minification and why does it matter?
CSS is render-blocking: a browser won't paint a single pixel of your page until it has downloaded and parsed every stylesheet in the <head>. That puts CSS file size directly on the critical rendering path — the chain of steps between a request and the first visible content. Minification shrinks that file by removing everything a browser doesn't need to interpret the rules: comments, indentation, line breaks, the spaces around braces, colons, and semicolons, and the redundant final semicolon before a closing brace. None of this changes how the CSS behaves; it only changes how many bytes travel over the wire. On hand-written CSS the saving is typically 20–40% before compression, and minified CSS also compresses better under gzip or Brotli because the byte patterns are more regular. In a production build you should minify automatically with cssnano, Lightning CSS, or your bundler so source files stay readable and you get a source map — this tool is for the ad-hoc cases: a snippet from a tutorial, an email signature, or a CMS field that never runs a build step. It collapses whitespace and strips comments; it does not rewrite color values or merge rules, so the output stays a faithful, predictable version of what you pasted.
Common use cases
Shrink a critical-CSS snippet you're inlining into the <head> to remove a render-blocking request.
Compress CSS for an HTML email or newsletter, where every kilobyte counts and there's no build pipeline.
Paste CSS into a CMS or page-builder field that doesn't minify automatically (WordPress 'Additional CSS', Shopify theme settings).
Check how much weight a third-party stylesheet adds before deciding whether to self-host it.
Clean up CSS copied from DevTools, which arrives with computed-style comments and inconsistent spacing.
Produce a one-line version of a rule to paste into a chat, ticket, or code-review comment.
Frequently asked questions
Will minification ever break my CSS?▼
How much smaller will my file get?▼
Should I minify or just rely on gzip?▼
Does this tool rewrite values like #ffffff to #fff?▼
Does it remove unused CSS?▼
Is my CSS uploaded anywhere?▼
Related tools
JWT Decoder
Decode JSON Web Tokens (JWT) instantly — inspect the header, payload, and signature claims. Runs entirely in your browser; tokens never leave your device. Safe for production secrets.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Catches syntax errors with line numbers, pretty-prints with adjustable indent, supports large payloads. Runs in your browser — no upload.
XML Formatter & Beautifier
Format and beautify XML documents — proper indentation, line breaks, namespace handling. Useful for SOAP responses, sitemaps, RSS feeds, and Android resource files.
Base64 Encoder & Decoder
Encode and decode Base64 strings.
URL Encoder & Decoder
Encode/decode URL-safe strings.
HTML Entity Encoder & Decoder
Convert special characters to/from HTML entities.