CSS Formatter
Paste a stylesheet — even one that arrived as a single line — and read it again. Each declaration gets its own line, nested blocks get their indentation, and comments stay where they belong.
The code never leaves this page: formatting happens in your browser.
- Free
- Files never leave your device
- No sign-up
- No file limit
How to use
- Paste the CSS into the first box.
- Pick the indent: two spaces, four, or a tab.
- Copy the result, or press «Minify» to compress it again.
Good to know
Why a naive formatter breaks stylesheets
Splitting on every semicolon and brace looks like it works until the file contains content: "a;b" or a data URI with an SVG inside url(). Both are ordinary in real CSS. This formatter reads the file character by character, so quoted strings and comments are carried across whole rather than chopped at the first punctuation mark.
Nesting that actually helps
Media queries, supports blocks and modern nested rules add a level of depth each, and the indentation follows. A blank line separates top-level rules so that a two-thousand-line stylesheet reads as a list of blocks instead of a wall of text.
Frequently asked questions
Are my comments preserved?
Yes. A comment on its own goes on its own line; a comment after a declaration stays with it.
Does it change my CSS?
No properties are renamed, reordered or dropped. Only whitespace moves — the stylesheet behaves exactly as before.
Is my code sent to a server?
No. Everything runs in your browser, so a stylesheet from a project under NDA stays on your machine.
What about SCSS or LESS?
Nested rules and comments format fine. Variables, mixins and control directives pass through unchanged rather than being understood.
Related tools
- CSS Minifier Paste a stylesheet and get it back compressed. The counter under the box shows the size before…
- HTML Formatter Paste HTML and read it. Each tag goes on its own line with the indentation its nesting deserves…
- JSON Formatter and Validator Paste JSON and get it formatted, validated or minified. The data stays in your browser — nothin…
- Base64 Encode and Decode Paste text to get Base64, or paste Base64 to get the text back. Cyrillic, Chinese and emoji all…
- Word Counter Type or paste your text and the counters update instantly — words, characters, sentences, parag…
- Case Converter Paste text, pick a case, get the result. Nine ways of writing the same words: the four everyday…
- CSV to JSON Paste a table, get JSON. The parser follows RFC 4180, so a cell like «Doe, John» stays one fiel…
- JSON Beautifier Paste a wall of minified JSON and read it like a document. Indentation appears as you type, and…