CSS Formatter & Beautifier
Format and beautify CSS stylesheets with sensible defaults. Everything runs in your browser, so your styles never leave the page.
About this CSS formatter
This is a free online CSS formatter and beautifier. Paste a minified or messy stylesheet into the input panel and you'll get a tidy, indented version in the output panel. Selectors, declarations, and media queries are laid out on their own lines so the rules are easy to scan and review.
Features
- Format CSS with 2 spaces, 4 spaces, or tab indentation.
- Preserve declaration order, comments, and existing values exactly.
- Newline between rules for visual breathing room between selectors.
- Copy the result or download it as a
.cssfile.
How it works
The tool uses the CSS beautifier from the open source js-beautify library, loaded into your browser on first use. It tokenizes the stylesheet, normalizes whitespace, and writes the result back with your chosen indentation.
Privacy
Your CSS never leaves your browser. The whole tool runs locally as JavaScript on this page, so you can safely paste in-house design system code, third-party stylesheets, or anything else without it touching a server.
Frequently asked questions
Does this tool send my CSS anywhere?
js-beautify library is fetched once from a public CDN, but your CSS text is never uploaded.