Readable CSS, original order
CSS Beautifier
Turn a compact stylesheet into readable CSS. Format nested rules and declarations while keeping comments, strings, URLs, custom property values, and the order of your styles.
Limit: 200,000 characters (UTF-16 units) and 256 KiB of UTF-8 text. Plain CSS only.
Shortcut: Ctrl+Enter or Command+Enter in the input editor.
Maximum 256 KiB. Opening a file replaces the input. Nothing is uploaded.
Selectable text only. Formatting does not validate property values or browser support.
Ready. Paste CSS or load the example.
What was formatted
- Rule blocks
- 0
- At-rules
- 0
- Declarations
- 0
- Custom properties
- 0
- Comments kept
- 0
How to beautify CSS
- Paste a stylesheet or open a local UTF-8 file. Choose Declarations only for a snippet such as
color:red;padding:1rem. - Choose your indentation and selector layout, then select Beautify CSS.
- Review the output and structural counts. Copy it or download
beautified.css. Keep a copy of the original when editing production styles.
Selectors are split only at commas outside functions and attribute brackets. A selector such as :is(.a,.b) stays intact. Existing descendant-selector spaces remain significant.
What the result means
The formatter adds indentation and line breaks at parsed rule boundaries, and spaces after ordinary property colons. It keeps the interior of ordinary values and the complete values of custom properties unchanged. It preserves comments, escape spelling, URLs, declaration order and existing semicolons. A final custom property without a semicolon stays attached to its closing brace to preserve its exact value boundary.
Counts describe parsed structure, including keyframe blocks. Custom properties are included in the declaration count. More output bytes usually means added readable spacing. This is a beautifier, not a minifier, linter or browser compatibility test.
Supported CSS and honest limits
Supports nested selectors, @media, @supports, @container, @layer, @scope, @starting-style, keyframes, font descriptors, custom properties, page margin blocks and common descriptor at-rules. Unsupported or structurally broken input produces a location and explanation, with no partial output.
Syntax and size limits
Compile Sass, SCSS or Less to CSS first. Unknown at-rules, HTML wrappers, legacy HTML comment markers, malformed strings or URLs, incomplete brackets, and ambiguous ordinary values containing top-level braces are refused. Ordinary values containing a top-level colon are refused because they may contain a missing semicolon or unsupported legacy syntax. Property names, selector grammar and property-value validity are not fully checked.
Limits are 50,000 lexical items, 64 levels of component nesting, 32 levels of rule nesting and 1 MiB of generated output, in addition to the input limits above. UTF-8 encoding declarations must be exactly at the start; other encodings are refused. An initial BOM is removed. Browser text editors may normalize line endings; new layout uses LF. Source maps and any line-based references need regeneration after formatting.
Privacy and safe handling
Tool code processes input in this browser tab. It does not send, save or log your CSS, create a sharing URL, load referenced assets, or apply your styles to the page. Local files stay local. Clear/reset removes the current input and result from the tool. Copy uses your browser clipboard, and download saves a UTF-8 file you control. The site's shared analytics and normal page requests are separate from this local processing.
Syntax references: CSS Syntax, custom property values, CSS nesting order and CSS math whitespace.