CSS Formatter
Format, beautify, or minify CSS code instantly
Why Use This Tool?
- Instantly format messy CSS into clean, readable stylesheets.
- Minify CSS to reduce file size for production deployment.
- Works entirely in your browser with no server processing.
How to Use
- Paste your CSS code into the input area
- Select your preferred indent size (2 or 4 spaces)
- The formatted CSS appears automatically on the right
- Use the Minify button to compress CSS for production
FAQ
Does this handle nested CSS like SCSS?
This tool formats standard CSS. Nested CSS from preprocessors like SCSS or Less should be compiled first. However, native CSS nesting is handled correctly.
Does it remove CSS comments?
Yes, CSS comments (/* ... */) are removed during formatting for cleaner output. The original input is preserved.
Can I minify CSS?
Yes. Click the Minify button to remove all whitespace, producing compact CSS suitable for production.
Does it handle media queries?
Yes. Media queries, keyframe animations, and other at-rules with nested blocks are formatted with proper indentation.