CSS Formatter & Minifier
Format and minify CSS locally in your browser. Nothing is uploaded.
Link to this tool
Copy this HTML to cite this tool from your own site or article.
About CSS Formatter & Minifier
CSS Formatter & Minifier formats CSS stylesheets with consistent spacing or compresses CSS code for optimized production delivery.
How to use CSS Formatter & Minifier
- Paste your CSS code into the editor field.
- Choose Beautify to expand selectors, or Minify to compress.
- Configure formatting rules like single-line selectors or 2-space indentation.
- Click Process CSS and copy the output.
Examples
Input: body{color:red;margin:0;} Beautified: body { color: red; margin: 0; }
FAQ
Does minifying CSS remove comments?
Standard CSS comments are removed during minification, while special preservation comments (/*! ... */) are retained.
Is CSS grid and flexbox syntax supported?
Yes. All modern CSS layout properties, media queries, and pseudo-classes format accurately.