Sign up free

CSS Beautifier and Formatter Online

Paste minified or cramped CSS and get one declaration per line, properly indented.

About CSS Formatter

A CSS beautifier makes a stylesheet readable again. You might need to change one color in a theme's style.min.css, want to see how another site builds its layout, or inherit a file that several people edited, each in their own style. Paste the CSS or open a file, and the formatted version appears as you type. When you change a color, the Color Converter gives you its HEX, RGB and HSL values.

Each declaration goes on its own line with a space after the colon, and rules are indented with 2 spaces, 4 spaces or tabs. Nested at-rules such as @media, @supports and @layer are indented one level deeper, so you can see which rules belong to which breakpoint. Comments are kept, and quoted strings, like content values and font names, are left as they are. When you've finished editing, the CSS Minifier packs the file back down. Everything runs in your browser, so the stylesheet is never uploaded.

How to use CSS Formatter

  1. 1
    Paste your CSS

    Paste the stylesheet or open a CSS file.

  2. 2
    Choose the indent

    Pick 2 spaces, 4 spaces or tabs, and the formatted CSS updates live.

  3. 3
    Copy or download

    Copy the result or download it as a file.

Why use Cubfile for this

  • One declaration per line

    Every property sits on its own line, with a space after the colon.

  • Nested at-rules

    @media, @supports and @layer blocks are indented so you can see what's inside.

  • Comments and strings kept

    Comments stay, and quoted values are left exactly as written.

  • In your browser

    Nothing is uploaded, nothing counts toward a limit, and it works offline once loaded.

FAQ

CSS Formatter: questions and answers

How do I unminify CSS and make it readable?
Paste the minified CSS or open the file and pick an indent. The rules are spread out one declaration per line, ready to copy or download.
Does the CSS formatter change my styles?
No. Only spaces, line breaks and indentation change. Selectors, values, comments and strings stay the same, so the browser applies exactly the same styles.
Does it handle media queries?
Yes. Rules inside @media, @supports and @layer are indented one level deeper than the at-rule, even when those blocks are nested inside each other.
Can I format the CSS inside an HTML page?
Use the HTML Formatter for that. It re-indents embedded style blocks along with the rest of the markup.
Does the CSS beautifier upload my stylesheet?
No. Formatting runs in your browser, needs no sign-up and doesn't count toward any daily limit.
Share CSS Formatter with a friendIt runs in any browser, and they can try it without signing up.

Related tools

HTML HTML FormatterIndent messy HTML so it’s easy to read.
JS JavaScript FormatterBeautify minified or messy JavaScript.
HEX Color ConverterConvert colors between HEX, RGB, HSL and CMYK, and check contrast.
CRON Cron Expression GeneratorBuild cron expressions and see the next run times in plain words.
CSS CSS MinifierMinify CSS to load faster.
HTML HTML MinifierShrink HTML by removing comments and extra whitespace.
HTTP HTTP Request TesterSend GET, POST and other requests to a public API and read the response.
JS JavaScript MinifierStrip comments and whitespace from JavaScript without changing how it runs.