UtilDojo

Popular

Menu

CSS Formatter, Beautifier & Minifier

  • This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.

CSS

Formatted CSS

Result appears here.

About this tool

Paste compressed or inconsistent CSS and get readable stylesheets with one rule per block and one declaration per line, formatted by Prettier. SCSS and Less syntax are supported.

Minify mode removes comments and unnecessary whitespace for a smaller file while keeping strings intact. It also drops the last semicolon before a closing brace. It is a whitespace-and-comments minifier only: it does not shorten colours, merge rules or delete unused selectors, so a build tool such as cssnano or Lightning CSS will shrink a production bundle further.

To use it, paste your code (or press Sample), pick CSS, SCSS or Less, and choose 2 spaces, 4 spaces or tabs. The result updates a moment after you stop typing, and you can copy it or download it as styles.css, styles.scss or styles.less. For example, .card{display:flex;gap:12px} becomes a .card { … } block with display: flex; and gap: 12px; each on its own indented line.

Two things to watch. Minify understands plain CSS only: SCSS and Less // line comments are not removed, and because line breaks are collapsed they can swallow the code after them, so compile preprocessor files before minifying. And Beautify wraps long values at 100 columns, so a very long selector list or font stack may be split over several lines.

Everything runs in your browser, so unreleased stylesheets never leave your machine.

Frequently asked questions

Does minifying change my CSS behaviour?

No. It only removes comments and whitespace that browsers ignore. Quoted strings and their contents are left exactly as written.

Can it format SCSS nesting and mixins?

Yes — choose SCSS (or Less) in the language menu before formatting. Nested rules, variables, @mixin and @include are indented like normal blocks. The language menu and indentation setting are only shown in Beautify mode.

Why do I see an error instead of formatted code?

Prettier refuses input it cannot parse, such as an unclosed brace or a stray character. The first line of its message is shown. The wrong language selected can cause this too: SCSS syntax fails under plain CSS.

Will it sort my properties or fix vendor prefixes?

No. Declarations stay in the order you wrote them and nothing is added, removed or rewritten apart from spacing and line breaks.

Is my code uploaded?

No. Formatting runs in your browser, and the Prettier engine is only downloaded when you open this page.

Related tools