Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    CSS Minifier

    Paste your CSS and get a smaller version for your live site. Comments, line breaks and extra spaces go. Values stay exactly as you wrote them, so nothing about how the page looks can change.

    Features

    • Removes comments, extra white space and the last semicolon in each block
    • Leaves strings, url() addresses, calc() spacing and custom properties untouched
    • Keeps /*! licence comments if you want
    • Shows the size before, after and the percentage saved
    • Runs on your device, so your code is never uploaded

    How to use CSS Minifier

    1. Paste your CSS or open a .css file.
    2. Choose whether to keep /*! licence comments.
    3. Check the size saved and any warnings.
    4. Copy the result or download styles.min.css.

    Frequently asked questions

    Is it safe? Can minifying break my CSS?

    This tool only removes comments and white space that has no meaning, and it never rewrites values. It keeps the spaces in calc(), the contents of strings and url(), and the value of custom properties. If your original CSS works, the minified version works the same.

    Why is the saving smaller than with other minifiers?

    Some minifiers also shorten colours, merge rules or drop units from zero values. Those changes can be risky and are left out here on purpose. Expect roughly 15 to 30 percent off a typical stylesheet. Your server can add more by compressing the file with gzip or Brotli.

    What are /*! comments?

    Comments that start with an exclamation mark are conventionally used for licence notices, such as the header of an open-source library. Many licences require them to stay in the file, so you can choose to keep them.

    Does it check my CSS for errors?

    It is not a validator, but it warns about problems that stop it from reading the file safely, such as a missing closing brace, an unclosed comment, string or url().

    Related tools