CSS Formatter & Beautifier

Pretty-print minified CSS with one declaration per line — purely in your browser.

convert² THE BEAUTIFIER
Enter format · K copy
INDENT
Input · raw
0 B 0 ln
1
Output · formatted
0 B 0 ln
{ }
awaiting input
paste code on the left
pick a format above
Original · A
0 B
Removed raw
Added
Original · B
0 B
↓ About this tool

CSS Formatter & Beautifier

Pretty-print minified CSS with one declaration per line — purely in your browser.

What it does

Production CSS is almost always minified: selectors and declarations run together, whitespace and comments stripped. Reading it in a debugger feels like staring at a wall.

convert2's CSS mode walks the input, re-emits each selector and each declaration on its own line, indents nested rules (media queries, supports queries) and preserves the comments that do survive minification.

How to use it

  1. Paste your CSS into the left pane.
  2. Each rule block goes on its own indented block in the output.
  3. Media queries, @supports and @keyframes format with proper nesting.
  4. Change indent width from the top-right control.

Example

Input
body{margin:0;font-family:sans-serif;background:#0a0d12}.btn{background:#ff5c2b;color:#fff;padding:10px 20px}@media (max-width:600px){.btn{padding:8px 14px}}
Output
body {
  margin: 0;
  font-family: sans-serif;
  background: #0a0d12;
}
.btn {
  background: #ff5c2b;
  color: #fff;
  padding: 10px 20px;
}
@media (max-width: 600px) {
  .btn {
    padding: 8px 14px;
  }
}

Why convert2

  • Reads the tricky cases. Media queries, @keyframes, @supports, vendor-prefixed rules — all formatted with proper depth.
  • Preserves comments. /* … */ blocks keep their place.
  • Local. Proprietary design system? Paste without worrying about it leaking to a third party.

Common use cases

  • Inspecting CSS from production bundles (after curl-ing or copying from DevTools).
  • Cleaning up compiled Sass/Less output before committing or reviewing.
  • Reading a vendor's stylesheet to understand their token system.
  • Normalising CSS snippets in documentation.

CSS Formatter specifics

  • Works on plain CSS. SCSS / Less source with nested selectors won't compile through this — compile first, format the output.
  • Does not minify. For minification, use a build-time tool like csso, cssnano or esbuild.
  • Does not lint or validate properties — unknown or misspelled property names pass through.
  • Keeps selector order exactly as input.

Frequently asked questions

Does it handle media queries and nested rules?

Yes. Media queries, @supports and @keyframes are formatted with proper block indentation and nested selectors.

Is it safe for production stylesheets?

Yes. All formatting runs in your browser, so proprietary CSS and design-system tokens stay local.

Can it minify CSS?

No. convert2 focuses on readability. For minification, use a dedicated tool during your build.

Will it work with SCSS or Less?

Only compiled CSS output. Compile first, then format here.

Other tools

copied