CSS Minifier - Minify & Beautify CSS Online
Minify CSS as you type, or beautify minified CSS back into readable code. See the size saved and gzipped size, then copy or download.
How to Use CSS Minifier
- 1
Paste your CSS, drop a .css file on the box, or press Open .css file.
- 2
Read the minified CSS and the bytes saved, and choose whether to keep license comments and shorten colors.
- 3
Copy the result or download it as a .min.css file. Switch to Beautify to make minified CSS readable again.
About CSS Minifier
The CSS minifier shrinks stylesheets so pages load faster. Paste or open your CSS and the minified version appears as you type, with the original size, minified size, percent saved and gzipped size side by side.
Safe minification
A quick find-and-replace minifier can break CSS. This one reads the code the way a browser does:
- Strings and url() values stay exactly as written.
- calc(), min(), max() and clamp() keep the spaces around + and - that they need to work.
- A space before a pseudo-class is kept, so .nav :hover doesn't turn into .nav:hover.
- /*! license comments stay by default.
Beautify CSS too
Switch to Beautify to turn minified or messy CSS into clean, indented code with one declaration per line, ready to read or edit. Everything runs in your browser.
Built by
Fateh Raiyan IshmumFull-stack dev since 2020. Full-stack web developer since 2020. Builds privacy-first, open-web tools. Specialises in Next.js, TypeScript, and performance-focused design.
Frequently Asked Questions
Paste your CSS into the box or open a .css file. It's minified as you type: comments, line breaks and extra spaces are removed, along with the last semicolon in each rule. Copy the result or download it as a .min.css file.
Comments, line breaks, indentation, spaces around braces, colons, semicolons, commas and selector combinators, and the final semicolon before each }. With Shorten colors on, six-digit hex colors that can be written in three digits become shorter, so #ffffff becomes #fff.
It shouldn't. Text inside quotes and url() is left exactly as it is, calc() keeps the spaces it needs around + and -, and a space before a pseudo-class is kept because .menu :hover and .menu:hover mean different things. License comments that start with /*! are kept unless you turn that off.
Usually 15 to 40% smaller, depending on how much whitespace and how many comments the original has. The Gzipped box shows the size after gzip compression, which is roughly what browsers download when your server compresses files.
Yes. Switch to Beautify and minified CSS is rewritten with one declaration per line, two-space indents and a blank line between rules, including nested rules and media queries, so you can read and edit it.
No. Minifying and beautifying happen in your browser, so private or unreleased stylesheets never leave your computer.
More Free Tools
Most Popular
Convert ASCII fractions like 1/2 and 3/4 into Unicode fraction characters. Copy and paste ½, ⅓, ¾, ⅝.
Generate random fruits from 60+ varieties. For games, recipes, grocery decisions, learning.
Generate random gibberish text. Each word is replaced with a random consonant-vowel pattern of the same length.
Pick random famous people from film and TV, music, sports, or comedy with category and no-repeat controls.