CSS Minifier
This page opens Minify mode. Paste a stylesheet or open its .css file, then run Minify CSS to remove optional whitespace, ordinary comments and empty semicolons. Cascade order, custom-property values, strings, url() values and /*! comments stay protected. The tool parses the output again and compares it with your input before showing the result. Choose one line or one line per rule, compare UTF-8 byte counts and download the complete CSS or unified diff.
The formatted or minified CSS appears here after it passes the check.
Your device's memory is the practical size limit. A run stops after 60 seconds, and Cancel stops it sooner. Your CSS stays in this browser tab and is not saved; only the settings you choose are remembered.
What Minify keeps
.a{width:calc(100% - var(--gap)*2)}:root{--shadow:0 1px 2px rgba(0,0,0,.2) , 0 8px 24px #0003}/*! MIT licence */.a{color:red}.card{.title{color:red}}
Each run parses your CSS with css-tree 3.2.1, writes it with Prettier 3.9.8 (Format) or css-tree (Minify), then parses the result again and compares its rules, selectors, values, strings, url() values, custom properties and /*! comments with your input. A result that differs is withheld. Everything runs in a background worker in this tab, and nothing is uploaded.
Common questions
- Does this CSS compressor combine or reorder rules?
- No. It removes optional source whitespace and ordinary comments without merging declarations, combining selectors or reordering the cascade. It does not create a gzip or Brotli archive or configure server compression.
- Are custom properties and calc() values preserved?
- Yes. Spaces around + and - inside calc() stay, because CSS needs them there; spaces around * and / go, because it does not. A custom-property value is kept exactly from its first character to its last, because scripts can read that text. The spaces before and after the value are the only part removed, and a value made only of spaces keeps them.
- Can I download or copy a large minified stylesheet?
- There is no fixed input-byte ceiling; your device’s memory is the practical limit. A run stops after 60 seconds, and Cancel stops it sooner. The source stays in this browser tab and is not saved. A long output is shortened only in the on-screen preview; Copy output and Download CSS contain the complete result. Only settings you explicitly choose are remembered.
- How do I turn a minified stylesheet back into readable CSS?
- Choose Format and run Format CSS, then download the formatted result. Formatting restores readable layout; deleted comments, old names and source maps cannot be reconstructed.
- Can I minify HTML, JavaScript or SCSS here?
- This page reads a standalone standard CSS stylesheet. Use the separate HTML or JavaScript tools for those source languages. It is not a Sass compiler or a complete SCSS formatter.
No unsafe property merging or reordered cascade; unsupported syntax is retained or rejected explicitly. Every result is parsed again and compared with your input before it is shown, and custom-property values, strings, url() values and /*! comments keep their exact text. It cannot see your HTML or test rendering, so check the result in the browsers you support.