CSS Beautifier
Beautify CSS online for free — paste minified or messy CSS and get clean, consistently indented code. Choose 2 spaces, 4 spaces or tabs, then copy or download. Powered by js-beautify; runs 100% in your browser.
100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.
Formatting uses the open-source js-beautify library and runs entirely in your browser, so private code is never uploaded.
How to beautify CSS
- Paste your CSS (or open a .css file).
- Pick the indentation you use.
- Click “Beautify” — pasting also formats automatically.
- Copy the formatted code or download it.
What you can use it for
- Read minified CSS from a website or framework
- Clean up messy, inconsistent stylesheets
- Review CSS before editing or debugging
- Format CSS copied from DevTools
More free tools
Building for the web?
Format, minify, convert and generate code with our free, private developer tools.
See all free tools →Frequently asked questions
How do I format CSS?
Paste the code and click “Beautify”. Indentation, line breaks and spacing are rebuilt consistently, without changing what the code does.
Is beautifying the opposite of minifying?
Yes. Minifying strips whitespace for production; beautifying adds it back so people can read it. To minify again, use our CSS Minifier.
Will beautifying change how my CSS works?
No. Only whitespace and line breaks change; selectors, properties and values stay the same.
Is my code uploaded?
No. Formatting runs in your browser with the open-source js-beautify library, so private code never leaves your device.
Is the CSS Beautifier free, and can I use the formatted code commercially?
Yes. It’s free to use, with no account or sign-up, and nothing to install. The formatted CSS is still your own code, so you can use it in client sites, commercial products or anywhere else without crediting us. The tool only changes spacing and line breaks, so any licence that came with the original stylesheet, such as a framework or theme licence, still applies.
What does the formatted CSS look like?
Each declaration goes on its own indented line, with a space after the colon. Selectors separated by commas are split one per line, and a blank line separates one rule from the next. Rules inside @media, @supports or @keyframes are indented one level further, and the file ends with a newline. Values such as calc(), url() and quoted strings keep their content.
Does it keep my comments and blank lines?
Yes, comments are kept. A /* */ comment between rules moves onto its own line above the next rule, and a comment inside a rule stays in place on its own line. Blank lines you left inside a rule are kept, but several in a row are reduced to one.
Does it work with SCSS or Less?
For formatting, generally yes. Nested rules, including & selectors, are indented by level, and SCSS $variables, Less @variables, @include lines, mixin calls and // line comments are kept as written. Paste the code into the box rather than relying on the file picker, which looks for .css and .txt files. The download is named formatted.css, so rename it to .scss or .less afterwards.
Can I open a CSS file and download the formatted result?
Yes. Click “Open file” to load a .css or .txt file from your device, and it’s formatted straight away. “Copy” puts the formatted code on your clipboard, and “Download” saves it as formatted.css. The file is read and saved in your browser, so nothing is uploaded. The line under the Beautify button shows how many lines the code had before and after.
Why does the indentation look wrong after formatting?
Uneven indentation usually means a curly brace is missing or extra in the original CSS. The formatter keeps your code as written rather than guessing, so an unclosed rule pushes everything after it one level in, and a stray } sits on a line of its own. Find the brace, fix it in the input box and click “Beautify” again. If the formatter fails to load, refresh the page.
Can I beautify HTML or JavaScript too?
Yes, with two matching tools. Our HTML Beautifier formats markup, including CSS and JavaScript inside style and script tags, and our JavaScript Beautifier formats scripts, including JSON. Both use the same open-source js-beautify library, run in your browser and offer the same 2-space, 4-space or tab indentation.