Loading Techie Utils…

SCSS / SASS Formatter & Beautifier

Format SCSS syntax and nested rules. Free, and runs entirely in your browser — nothing you enter is uploaded, stored or sent to a server.

About SCSS/SASS Formatter

SCSS is CSS with nesting, variables, mixins and // comments, and the layout problem it creates is the one nesting always creates: a rule four levels deep is unreadable unless the indentation is exact, and it stops being exact the moment anybody edits it by hand.

This lays it out by following the braces, which is what nesting actually is. Three things get special handling because a plain CSS formatter would damage them: // comments run to the end of the line and would otherwise swallow a declaration moved onto them; #{$name} interpolation contains braces that must not change the indent; and @use, @forward and @import end in a semicolon rather than opening a block.

The indented .sass syntax — no braces, no semicolons, meaning carried entirely by indentation — is a different language. It is not read here, because converting between the two is a rewrite rather than a reformat and a formatter that tried would produce something that was neither.

Where it helps

  • Understands nesting, so a deeply nested rule is indented by what it actually is rather than by guesswork.
  • Handles // comments, which plain CSS has no concept of and which a CSS formatter will happily break.
  • Leaves #{…} interpolation alone, so a computed selector does not push everything after it one level too deep.
  • Adds the semicolon a block's last declaration is usually missing, which is a real source of SCSS compile errors.
  • Runs in the browser with no dependency, so an unreleased stylesheet does not have to be pasted into a third-party service.

Limits

  • It formats rather than compiles: it will lay out SCSS that does not build, and it will not tell you that it does not build.
  • The indented .sass syntax is a different language and is not read here.
  • Long selector lists and long values are not wrapped to a column limit — the layout follows structure, not width.
  • It does not sort properties, merge duplicate rules, or make any other opinionated change to what you wrote.

Frequently asked questions

Does this work on plain CSS?

Yes — plain CSS is valid SCSS, so it will be laid out correctly. The CSS Formatter is the more direct choice if that is all you have, but nothing goes wrong if you use this one.

Will it compile my SCSS to CSS?

No. It formats the source and leaves it as SCSS. Compiling means resolving variables, mixins and imports, which needs the whole project rather than one file.

Why is my .sass file mangled?

Because .sass is the indented syntax, which has no braces or semicolons at all, and this formatter follows braces. The two are different languages that share a name — convert the file to .scss first.

Related tools

More Web Development tools