Minify or beautify CSS code
- Free
- No sign-up
- No upload
- Works offline
Tool facts
- Opens
CSSSCSSLESS- Saves as
CSS- Price
- Free, no sign-up, no watermark
- Are files uploaded?
- No. Everything is processed in this browser, on your device.
- Batch processing
- One file at a time
- Offline use
- Works without a connection once this page has loaded
- Built with
- js-beautify
- Browser
- A recent Chrome, Edge, Firefox or Safari, on computer or phone.
Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.
About CSS Minifier
CSS Minifier removes comments, line breaks and unnecessary spaces from a stylesheet so it downloads faster, and can turn minified CSS back into neatly indented code. It reads the CSS token by token, so text inside quoted strings, unquoted url() paths and the spaces that calc() needs around + and - are left exactly as they were, and the result is the same stylesheet in fewer bytes.
Optional value shortening rewrites #aabbcc as #abc, 0.50 as .5 and 1.0s as 1s, but only inside declarations, never in selectors such as an id named #aabbcc. Comments that start with /*! are kept by default because they usually carry licence notices. The before and after sizes show how many bytes you save. Everything runs locally, so private stylesheets are not sent anywhere.
CSS Minifier runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.
How to use CSS Minifier
- Paste your stylesheet into the Input box, or drop a .css file onto the page.
- Choose Minify or Beautify under Mode.
- For Minify, decide whether to keep /*! comments and shorten values; for Beautify, pick 2 spaces, 4 spaces or tabs.
- Check the Before and After sizes, then click Copy or Download to save the result.
Frequently asked questions
Can minifying break my CSS?
This minifier only removes whitespace and comments where they have no meaning, and it keeps spaces that matter, such as between descendant selectors (div p), around + and - inside calc(), and inside strings and url(). If you turn on value shortening it also changes number and color notation, which browsers treat as identical.
How much smaller will my CSS get?
Hand-written, commented CSS usually shrinks by 15 to 35 percent. Files that are already compact save less. Your web server's gzip or Brotli compression reduces the transfer size further, and minified files still compress slightly better.
Which comments are kept?
All comments are removed except those that begin with /*!, the common convention for licence and copyright notices. Turn off Keep /*! comments to remove those as well.
Does it work with SCSS or Less?
Beautify works for most SCSS and Less syntax. Minify is designed for plain CSS; it does not understand // line comments used in SCSS and Less, so compile those files to CSS first.
Does it remove unused CSS or merge rules?
No. It does not know which selectors your HTML uses, so it never removes rules or reorders them. That keeps the output safe, because rule order changes how styles cascade.