CSS Minifier
Paste a stylesheet and get a smaller copy. Only comments, extra whitespace and the last semicolon in each block go; everything else stays as you wrote it.
Paste CSS to see it minified.
Your CSS stays on your device: nothing is sent or saved. Up to 5 MB.
A smaller stylesheet that still works the same
Every comment, indent and line break in a stylesheet is downloaded by every visitor. This minifier removes them, and nothing more. It reads your CSS the way a browser does, piece by piece, so it can tell a space that separates two selectors from one that only lines things up, and it never has to guess what a rule means.
How to use it
- Paste your CSS into the top box. The minified copy appears below as you type.
- Leave “Keep /*! license comments” on unless you’re sure no notice needs to stay.
- Read the share saved and the list of what was removed, plus any warnings.
- Copy the result, or download it as a .css file.
What it removes
- Comments, except /*! ones when you keep them.
- Whitespace around braces, colons, semicolons, commas and the >, + and ~ combinators.
- The semicolon right before a closing brace, which CSS doesn’t need.
What it never touches
- Anything in quotes, such as content strings and grid-template-areas, and the address inside url().
- Spaces CSS needs: between selectors, around + and - in calc(), and before a bracket in a media query.
- Your values and names. It doesn’t shorten colors, drop units or merge rules. Tools that do can save more, but each rewrite is a chance to change what the CSS does.
Good practice
- Minify as the last step before you publish, after you’ve tested the readable version.
- Name the file clearly, for example style.min.css next to style.css, so nobody edits the minified copy by mistake.
- Check the page afterwards at phone and desktop widths. The result should look identical; if anything differs, the warnings are the first place to look.
Good to know
- Broken CSS isn’t fixed. If a brace, quote or comment is never closed, you’ll see a warning naming the problem, and the output keeps it as it was.
- Keep your original. Minified CSS is hard to edit, so change the readable copy and minify again.
- Pictures weigh more than stylesheets on most sites. The Image Compressor shrinks them, and SVG to PNG turns vector art into images any app can use.
Frequently asked questions
Does it rewrite my CSS?
No. It removes comments, whitespace that has no effect, and the semicolon before each closing brace. Colors, numbers, selectors and the order of your rules stay exactly as you wrote them, so the result behaves the same.
Why are some spaces still there?
Because CSS needs them. A space between two selectors means “inside”, calc() needs spaces around + and -, “and (” in a media query must keep its space, and the text inside quotes and url() is never touched. Custom properties keep their inner spaces too, because scripts can read their exact value.
What are /*! comments?
A comment that starts with /*! is the usual way to mark a license or copyright notice that should stay in minified files. Keep the option on if your CSS includes code from someone else’s project whose license asks for its notice to be kept.
Is my CSS sent anywhere?
No. It’s minified in this page, on your device, and nothing is sent or saved.