CSS Formatter & Minifier
Format and beautify your CSS with clean, consistent indentation, or minify it for production, instantly. Choose the mode and indent size (2 or 4 spaces or tab) and copy or download the result. The formatter respects your selectors, values, strings and comments: it only rearranges whitespace, it never changes what your CSS means. Everything happens in your browser: nothing is uploaded to any server.
How to format or minify CSS
- Paste your CSS into the box on the left.
- Choose the mode: “Format” to beautify it with indentation or “Minify” to compress it.
- If you format, choose the indent size (2 or 4 spaces or tab).
- Copy the result with “Copy” or download it as a .css file with “Download”.
Frequently asked questions
What is the difference between formatting and minifying CSS?
Formatting (or beautifying) adds indentation and line breaks so the CSS is readable and easy to maintain. Minifying does the opposite: it removes unnecessary spaces, line breaks and comments to shrink the file size and speed up page load. You use formatted CSS while developing and minified CSS in production.
Does the formatter change my CSS?
It does not change what it means: it only rearranges whitespace. It keeps your selectors, values, text strings and comments exactly as you wrote them, so the result is always valid CSS that is equivalent to the original. It never rewrites or “fixes” your properties.
What syntax does it support?
Modern CSS: at-rules like @media, @supports, @keyframes, @font-face and @import; nested rules; custom properties (CSS variables); comments and strings containing braces or semicolons. Because it respects tokens, it also tidies up similar syntax such as SCSS or LESS reasonably well, although it is designed for CSS.
Is minification safe?
Yes. It removes comments and unnecessary spaces (including the extra ones inside media queries and around commas and combinators), but it never touches the content of your rules or the inside of strings. Minified CSS behaves exactly like the original.
Does it validate my CSS?
It is not a validator, it is a formatter. It rearranges whitespace even if the CSS has typos, without corrupting its content; if closing braces are missing, it completes them when formatting. To detect invalid properties or syntax errors, use your browser’s developer tools.
Is my CSS uploaded to a server?
No. Formatting and minifying happen entirely in your browser with JavaScript; your CSS never leaves your device and the tool works offline once loaded.