CSS Formatter & Beautifier
Paste minified or messy CSS and get it back with one property per line, two-space indentation, and a blank line between rules. Everything runs in your browser.
How to use this tool
- 1
Paste your minified or unformatted CSS into the text box.
- 2
Read the formatted result that appears instantly in the output panel below.
- 3
Select the output text and copy it (Ctrl/Cmd+C) into your stylesheet or editor.
- 4
Tweak the input and the output re-formats live as you type.
What does a CSS formatter actually do?
CSS sent to browsers is often minified: all newlines, indentation, and optional spaces are stripped so the whole stylesheet collapses onto one line to save bytes. That is great for download size but painful to read or debug. A formatter reverses the cosmetic part: it re-inserts line breaks and indentation so each declaration sits on its own line, opening braces get a space before them, and every rule is separated by a blank line. It does not change which selectors match or how the cascade resolves; the parsed result is identical. This particular tool is deliberately lightweight. It works by running a handful of regular-expression substitutions over the text: it collapses runs of whitespace, then breaks after each { and ; and around }, then indents two spaces. Because it is a regex pass rather than a real CSS parser, it handles ordinary rules well but does not understand context. Semicolons or braces that appear inside string values, data: URIs, or /* comments */ are treated like real syntax and can be split onto the wrong line. Nested at-rules such as @media or @supports blocks are not re-indented an extra level. For everyday hand-written CSS the output is clean and correct; for tricky edge cases reach for a full parser-based tool like Prettier or stylelint.
Common use cases
Un-minifying a production .css file you pulled from a CDN so you can read what a rule actually does.
Cleaning up CSS that was pasted as a single line out of browser DevTools or a build artifact.
Tidying inconsistent indentation in a hand-edited stylesheet before committing it to version control.
Making a vendor or third-party widget stylesheet legible enough to override specific properties.
Preparing a readable CSS snippet to paste into a blog post, tutorial, or Stack Overflow answer.
Quickly inspecting the structure of an unfamiliar stylesheet to find where a selector is defined.
Frequently asked questions
Does it preserve /* comments */ exactly?▼
Will formatting change how my CSS behaves?▼
Does it handle @media or other nested at-rules?▼
Is my CSS uploaded to a server?▼
Can it minify CSS too, or only beautify it?▼
Why does my output look wrong on complex CSS?▼
Related tools
JWT Decoder
Decode JSON Web Tokens (JWT) instantly — inspect the header, payload, and signature claims. Runs entirely in your browser; tokens never leave your device. Safe for production secrets.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Catches syntax errors with line numbers, pretty-prints with adjustable indent, supports large payloads. Runs in your browser — no upload.
XML Formatter & Beautifier
Format and beautify XML documents — proper indentation, line breaks, namespace handling. Useful for SOAP responses, sitemaps, RSS feeds, and Android resource files.
Base64 Encoder & Decoder
Encode and decode Base64 strings.
URL Encoder & Decoder
Encode/decode URL-safe strings.
HTML Entity Encoder & Decoder
Convert special characters to/from HTML entities.