CSS Minifier

Shrink your CSS by removing comments, spaces and line breaks, shortening colours and values, and merging duplicate rules. Licence comments that start with /*! can be kept. See how many bytes you save.

Your CSS

Minified CSS

    How to use the CSS Minifier

    1. Paste your CSS, or use Try an example.
    2. Choose whether to merge rules and keep licence comments.
    3. Copy the minified CSS or download it as style.min.css.

    Your data stays on your device. This tool runs entirely in your browser. Nothing you type or paste is sent to our server or saved. Read our privacy policy.

    What minifying CSS does

    Minification makes a stylesheet smaller without changing how the page looks. It removes comments, spaces and line breaks, shortens values (#ffffff becomes #fff, 0px becomes 0) and, with merging on, combines duplicate selectors and rules.

    Why it matters for speed and SEO

    CSS blocks the page from showing until it has downloaded. Smaller CSS means the page appears sooner, especially on slow mobile connections, which helps your Core Web Vitals. Savings of 20–40% are typical for hand-written stylesheets.

    Keep a readable copy

    Never edit the minified file. Keep your original style.css for editing and upload the minified style.min.css to your site. If you lose the original, the HTML Formatter can re-indent CSS inside a style tag, but comments are gone for good.

    Licence comments

    Comments that start with /*! are licence notices that many open-source licences require you to keep. Leave “keep licence comments” on when you use frameworks or libraries.

    When merging rules can be risky

    Merging is safe for normal stylesheets. If your CSS relies on the exact order of repeated selectors for browser hacks, turn merging off and compare the result.

    Frequently asked questions

    Is minified CSS safe to use?

    Yes. Minifying removes only things browsers don’t need, such as comments and spaces, and rewrites values in shorter but equivalent forms, like #ffffff to #fff.

    What does Merge and shorten rules do?

    It combines rules with the same selector or the same declarations and removes overridden properties. It gives the smallest file. Turn it off if you need the rules to stay in their original order for some reason.

    Should I keep my original CSS?

    Yes. Keep the readable version for editing and upload the minified version to your website.