Tools · CSS · CSS minifier & beautifier
CSS minifier & beautifier
Minify or beautify CSS, live as you paste, entirely in your browser.
Add a file and run the tool.
Your file is ready.
Try a different file, or try again.
Settings
Adjust the settings below. The result updates as you go.
Runs fully in your browser. Nothing is uploaded.
Runs fully in your browser. Nothing is uploaded.
How it works
Paste your CSS, or start from the sample already in the box.
Choose Minify or Beautify, and an indent size for Beautify.
Copy the result.
Frequently asked questions
No. Minifying and beautifying both run entirely in your browser.
No. This is a real tokenizer, not a whitespace-stripping regex - it tracks comment, string, and url() boundaries, and copies their contents verbatim, whitespace and all. content: "a b" and url("x?a=1 b=2") both come out exactly as you typed them.
Shown live as a real percentage, calculated from your actual input and output byte sizes - not a fixed claim. It depends on how much whitespace and how many comments the original has.
It still produces a best-effort result, plus a plain note that the braces looked unbalanced - it doesn't throw an error or refuse to run.
Guides
A closer look at specific problems this tool solves.
Why Minify CSS, and Why a Whitespace Regex Is the Wrong Way to Do It
Minifying CSS removes bytes a browser has to wait for before it paints anything. Doing it with a find-and-replace on whitespace is how valid CSS turns into a stylesheet the browser silently ignores.
Read the guideHow to Minify CSS Without Breaking It
Paste a stylesheet, keep the mode on Minify, and copy the result. This walks through what the tool removes, the two options that keep things, and how to read the byte counts it shows.
Read the guideHow to Beautify Minified CSS So You Can Debug It
A production stylesheet is one long line. Beautify mode turns it back into one declaration per line so you can find the rule that is overriding yours. It cannot bring back comments that were already removed.
Read the guide
Comments