🎨

CSS Formatter & Minifier

Format and minify CSS code

Input CSS
Output

About CSS Formatter & Minifier

CSS from DevTools, design tool exports, or copy-pasting from Stack Overflow tends to be inconsistently indented and hard to maintain. The formatter adds proper indentation and line breaks. Minify strips whitespace and comments for production — typically 20-40% size reduction depending on how verbose the original is. Minification only removes whitespace, it does not change the cascade or any property values. Works with modern CSS including custom properties, nesting, @layer, and container queries.

Common Use Cases

  • Cleaning up CSS pasted from DevTools or design tools
  • Minifying stylesheets before production deployment
  • Standardising code style across a stylesheet before a review
  • Reducing page load time by stripping unnecessary whitespace

Frequently Asked Questions

Does minification break anything?+
No. Minification only removes whitespace and comments — the computed styles are identical. If minification breaks something, the original CSS has a bug that the whitespace was accidentally masking.
How much smaller does minification make CSS?+
Typically 20-40% depending on whitespace and comment density in the original. For a heavily commented framework stylesheet, savings can be larger.
Should I minify manually or use a build tool?+
Build tool (Vite, webpack, PostCSS with cssnano) in any real project — it runs automatically and integrates with source maps. Use this tool for quick one-off tasks or when you do not have a build pipeline.