Skip to content

CSS Minifier

Shrink CSS by removing whitespace and redundant code.

  • 100% Free
  • No Sign Up
  • Works in Your Browser

CSS minifier

Minify CSS to cut file size

Everything runs in your browser. Nothing is uploaded.

More Developer Tools

View all tools

Every everyday developer tool, right in your browser.

No installs. No uploads. No signup.

Browse all 36 tools
Developer tools
36
Cheat sheets
10
Bytes uploaded
0

How to use the CSS minifier

Three steps, all in your browser.

  1. 1

    Paste your input

    Type or paste your code or data. Press Sample to try an example.

  2. 2

    Pick the style

    Choose indentation or options. The result updates as you type.

  3. 3

    Copy the result

    Copy the output in one click. Nothing is saved or sent anywhere.

CSS Minifier: what to know

The CSS minifier uses CSSO (CSS Optimizer), an open-source minifier that goes beyond removing whitespace. Besides stripping spaces, line breaks and comments, it rewrites values in shorter equivalent forms (#ffffff to #fff, 0px to 0, bold to 700 where safe) and merges or removes rules when that can't change the result.

Structural optimization is what sets CSSO apart: identical declarations in neighboring rules can be merged and overridden declarations removed. It only makes changes it can prove are safe under the cascade, so a valid stylesheet should render the same. The tool shows the size before and after.

Comments that start with /*! are a convention for license notices, and CSSO keeps the first one. Keep your original, readable CSS as the source; minified CSS is a build output, not something to edit.

Popular uses

  • Shrinking CSS for a static site with no build step
  • Minifying a snippet for an email or CMS
  • Checking how much smaller a stylesheet can get
  • Preparing inline critical CSS for the head of a page

Tips for the best result

  • Serve CSS with gzip or Brotli too: compression and minification add up.
  • Test the minified CSS on the real page, especially if the stylesheet relies on browser hacks.
  • Small inline critical CSS benefits most, because it's sent with every HTML page.

Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.

Frequently asked questions