Format Code Now
/
ConvertSass to SCSS Converter Next: Sass to Stylus Converter ›

Sass to SCSS Converter

CV-51

Turn indented Sass into SCSS. The language is the same; indentation becomes braces and semicolons, and the = and + shorthands become @mixin and @include.

Runs in your browser. Nothing is uploaded.

Sass code

SCSS code

How to use it

  1. Paste your Sass into the input box, or open a .sass file.
  2. Pick the indent width for the output.
  3. Press Convert to SCSS.
  4. Copy the SCSS or download it as a .scss file.

What the converter does

Each indented block gets braces and each declaration a semicolon. Lines starting with = become @mixin and lines starting with + become @include. A selector or value that continues on the next line after a comma is joined. A // comment at the end of a line stays after its statement, and multi-line /* */ comments are kept.

Indentation rules

The input must indent each level consistently. A mix of tabs and spaces in one line, or a dedent to a column that no parent used, stops with an error that names the line. Blank lines are ignored, and a comment whose continuation lines are indented deeper is read as one comment.

Check it

Everything else, such as variables, @use, @if, maps and interpolation, passes through unchanged since both syntaxes describe the same language. Compile the SCSS with the SCSS to CSS tool and compare it with the Sass to CSS result for the original to confirm they match.

Error messages and what to do

MessageWhat it meansFix
Inconsistent indentation on line 3.A line is indented by an amount that does not match its siblings or any level above it.Indent every child of a rule by the same number of spaces.
Line 4 mixes tabs and spaces in its indentation.One line starts with both tabs and spaces.Use only spaces or only tabs for indentation.

Questions people ask

How do I convert Sass to SCSS?

Paste the indented Sass and press Convert to SCSS. Braces and semicolons are added from the indentation, and the = and + shorthands become @mixin and @include. The output is ready for a .scss file.

Does the conversion change the compiled CSS?

No. Both syntaxes compile to identical CSS. The tests for this tool compile the Sass and the generated SCSS with Dart Sass and compare the results.

Why do I see an indentation error?

The converter needs every child in a block to start at the same column. If one line is indented differently, or a line mixes tabs and spaces, it stops with the line number rather than guess where the block ends.

What does the = and + syntax become?

A line like "=box($w)" becomes "@mixin box($w) {" and "+box(1px)" becomes "@include box(1px);". Those two shorthands exist only in the indented syntax, so SCSS needs the long forms.

Are comments preserved?

Yes. // comments, including those at the end of a line, and /* */ comments are kept. A comment whose later lines are indented deeper counts as one multi-line comment.

About this tool

Converts between the two Sass syntaxes without changing any meaning. Indentation becomes braces and semicolons, the short = (mixin) and + (include) forms become @mixin and @include, and a selector or value that continues on the next line after a comma is joined. A // comment at the end of a line is kept after the statement. The input must use one consistent indent; mixed tabs and spaces, or an indent that does not match any level above it, give an error with the line number.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.