Developer Tools

CSS Minifier

Minify CSS stylesheets online for free — strip comments, collapse whitespace, and shrink file size, instantly inside your browser.

Private by default Instant results No signup
CSS MinifierLive
CSS source
Minified output
0Original size (chars)
0Minified size (chars)
0%Size reduction
Overview

What is CSS minification?

CSS minification strips out everything a browser doesn't need to apply a stylesheet's rules — comments, extra whitespace, and redundant characters — shrinking the file without changing how a single element is styled. Smaller CSS means a faster download and a faster first render, especially on a stylesheet with a lot of formatting whitespace or leftover comments from development.

This tool works directly on pasted or uploaded CSS, with each cleanup rule available as its own toggle, so it's clear how much each one actually contributes to the final file size.

Guide

How to use it

1Paste or upload your CSS
2Toggle the cleanup rules you want applied
3Check the size reduction in the stat row
4Copy or download the minified result

How each option works

"Remove comments" strips every /* comment */ block from the stylesheet. "Collapse whitespace" removes the spaces and line breaks around punctuation like {, }, :, and ;, and drops the trailing semicolon before a closing brace, since it isn't required there. "Remove empty rules" deletes selectors that have no declarations left inside them — often the result of removed styles during development. "Shorten hex colors" collapses six-digit hex colors down to their three-digit form when every pair of digits repeats, so #ffffff becomes #fff.

Why it helps

Features & benefits

Four independent cleanup rules you can mix and match
Live before/after size and percentage saved
Upload a .css file or download the minified result
Doesn't change selector specificity or rule order
100% private — nothing leaves the device

Why this runs entirely in your browser

Stylesheets can include unreleased design work or internal brand details, so nothing is uploaded. Every cleanup rule runs in JavaScript locally in the tab, which means it keeps working offline once the page has loaded and nothing pasted into it persists after the tab is closed.

A note on advanced CSS

This tool focuses on safe, purely syntactic cleanup — it doesn't merge duplicate selectors, reorder rules, or restructure media queries, since those changes can alter which rule wins when specificity is equal. For most stylesheets that's exactly what you want: a smaller file with identical rendered output.

Frequently asked questions

A few things people usually want to know before trusting the numbers.

No — it only removes comments, whitespace, and other characters browsers ignore anyway. The rendered result is identical.

It collapses six-digit hex colors to their three-digit form when possible, so #ffffff becomes #fff — a smaller, equivalent value.

No, it intentionally leaves rule structure and order untouched to avoid any risk of changing which rule applies when specificity is equal.

Yes. Use the upload icon above the input box to load a .css file directly.

No. All minification happens locally in your browser. Nothing typed or uploaded here is sent to a server, stored, or shared.