snaptools
C
CSS Formatter error
⌃⏎ run · clear · / focus input
// about this tool

CSS Formatter Online

Updated 2026-07-09

Format and beautify CSS online for free. Paste minified or inconsistently indented CSS and SnapTools rewrites it with one declaration per line, consistent spacing, and clearly nested at-rules — ready to copy or download. Everything runs in your browser, so your stylesheet is never uploaded.

Minified or machine-generated CSS is nearly impossible to edit or review by hand. This tool restores readable structure without touching a single selector or value, so the rendered output stays identical while the source becomes easy to scan, diff, and maintain.

// how to use

  1. 1 Paste minified or messy CSS into the input panel on the left.
  2. 2 SnapTools re-indents it with one rule per line and consistent spacing as you type.
  3. 3 Choose your indent size, then copy or download the formatted stylesheet.

// examples

Minified CSS to readable
Input
body{margin:0;font:14px/1.5 sans-serif}a{color:blue}
Output
body {
    margin: 0;
    font: 14px/1.5 sans-serif;
}

a {
    color: blue;
}
Nested media query
Input
@media(max-width:600px){.nav{display:none}}
Output
@media (max-width: 600px) {
    .nav {
        display: none;
    }
}

// common uses

Making minified or third-party CSS readable for editing Standardising indentation across a stylesheet Reviewing a diff of CSS changes cleanly Learning how a compressed stylesheet is structured

// faq

No. Formatting runs entirely in your browser, so your stylesheet never leaves your machine.
No. Only whitespace and indentation change — selectors, properties, and values are preserved exactly, so the rendered result is identical.
Yes. Media queries, keyframes, and other at-rules are indented so their inner rules are clearly nested and easy to scan.
Match your project. Four spaces is a common default, but you can switch to two spaces or tabs to fit your existing code style.
The formatter expands CSS to make it readable for editing; the minifier does the opposite — it strips whitespace to shrink the file for production.

Use this via API

Get a free API key →
curl -X POST https://snaptools.dev/api/v1/tools/css-formatter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"body{margin:0;font:14px/1.5 sans-serif}a{color:blue}"}'
Esc
↑↓ navigate open Esc close