CSS Minifier

    Compress CSS to improve page load times or format for readability.

    Input CSS
    Output
    Minified result will appear here...

    How to Use

    1. 1

      Input CSS

      Paste your CSS or upload a file.

    2. 2

      Minify or Beautify

      Choose to compress for production or format for reading.

    3. 3

      Export

      Copy and save the result.

    How This CSS Minifier Works

    This CSS minifier shrinks a stylesheet by stripping comments and unneeded whitespace, and its Beautify option spreads compact CSS back out into indented rules you can read.

    What minification removes

    • Every /* ... */ comment.
    • Line breaks, plus the spaces around { } : ; , and the > ~ + combinators.
    • The last semicolon before each closing brace.

    It does not rename or merge rules, shorten color values or remove unused selectors, so the savings come from whitespace and comments. The badge above the output shows the original size, the minified size and the percentage saved.

    Why minify CSS

    Stylesheets linked in the page head are render-blocking: the browser waits for them before it paints. Smaller files arrive sooner, and minification adds to server compression such as gzip or Brotli rather than replacing it. Most projects minify during the build, so a browser tool is most useful for one-off files, snippets for a CMS or email template, or checking how much a stylesheet shrinks.

    Check the output before shipping

    This minifier uses pattern-based text replacements, not a full CSS parser. Review the result when your CSS contains:

    • calc() with addition: calc(1px + 2px) becomes calc(1px+2px), which browsers reject because + needs a space on each side.
    • Quoted strings, such as content values, where spaces around colons and commas are removed too.

    Keep the unminified file in source control. Beautify restores indentation, but not the comments that were removed.

    Frequently Asked Questions

    Process of removing unnecessary characters (whitespace, comments) to reduce file size.

    Yes, 100% client-side. Your code never leaves your browser.

    Yes, use the 'Beautify' button to make minified CSS readable again.

    Related Tools