Frontend Tools
CSS Beautifier and Formatter
Turn minified CSS into readable code: one declaration per line, nested and @media rules indented, selector lists split, and strings and data URIs left intact.
How to use CSS Beautifier and Formatter
Paste CSS into the box and the formatted result appears next to it. Choose the indent, whether each selector in a list gets its own line and whether rules are separated by a blank line, then copy.
- Paste your CSSPaste minified or messy CSS, including @media blocks and native CSS nesting.
- Pick the layout optionsChoose 2 spaces, 4 spaces or Tab, split selector lists onto separate lines and add blank lines between rules.
- Check and copyIf the opening and closing braces don't balance, a warning appears; otherwise copy the result.
What formatting changes
body{color:red;margin:0} becomes four lines: the selector with an opening brace, color: red; and margin: 0; indented beneath it, and a closing brace. A space follows each colon and comma, @media (max-width:600px) becomes @media (max-width: 600px) with its rules indented a level deeper, and combinators gain spaces, so a>b+c reads a > b + c. Comma-separated selectors such as .nav a:hover, .nav a:focus can each take their own line, and nested rules such as &:hover inside .card are indented under their parent.
What is deliberately left alone
Strings and url() contents are copied as they are, so a data:image/png;base64 URI is not split at its semicolon. The space in div :first-child is a descendant combinator and is kept, because div:first-child means something else. Brackets in :nth-child(2n+1) get no extra spaces, custom property values starting with -- are only trimmed, and comments stay. Formatting does not validate property names or values, so a typo stays a typo; the only check is a count of opening and closing braces.
Accuracy and data handling
After adding generated code to a project, test it in the target browsers and responsive sizes. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
Does beautifying CSS change how the page looks?
No. Only whitespace, line breaks and indentation change. Meaningful spaces in selectors, strings and url() values are kept, so the rules behave exactly as before.
Does it support @media and CSS nesting?
Yes. @media, @supports and other block at-rules, as well as native nested rules written with &, are indented level by level.
How is this different from a CSS minifier?
A beautifier adds whitespace for reading and editing, while a minifier strips whitespace and comments to make the file smaller for production. Use the CSS Minifier on this site when you're ready to ship.
More Frontend Tools
Related toolsReformat compressed JavaScript into indented, readable code without touching strings.
Convert between px, rem, em, % and pt using your own root and parent font sizes.
Build fluid clamp() font sizes and spacing that scale between two viewport widths.
Score CSS selectors as (A, B, C) and rank them by specificity.
Generate CSS transition code with easing presets, a curve preview and reduced-motion CSS.
Build responsive CSS grid columns with auto-fit, auto-fill or a fixed count, previewed live.