SCSS to Sass Converter
CV-55Change SCSS into the indented Sass syntax. The language is the same; only the punctuation changes: braces and semicolons are replaced by indentation.
Runs in your browser. Nothing is uploaded.
SCSS code
Sass code
How to use it
- Paste your SCSS into the input box, or open a .scss file.
- Pick 2 spaces, 4 spaces or a tab for the indent.
- Press Convert to Sass.
- Copy the Sass or download it as a .sass file.
What changes
Braces and trailing semicolons are removed and nesting is shown by indentation. @mixin and @include are kept in their long form, which the indented syntax accepts. Comments are kept, including a comment at the end of a line. A statement spread over several lines is joined, and a multi-line value is written on one line.
What stays
Variables, maps, @use, @if, @each, interpolation and every other Sass feature pass through untouched, because the two syntaxes describe the same language. Rules with an empty body are dropped since the indented syntax cannot write one, and that never changes the CSS.
Check it
The result is compiled by Dart Sass in tests and compared with the compiled SCSS to make sure the meaning matches. You can do the same on this site with the SCSS to CSS and Sass to CSS tools. Convert back with the Sass to SCSS tool if you change your mind.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Missing } to close the block opened on line 3. | A rule or at-rule was opened with { and never closed. | Add the missing } at the end of the block that starts on the named line. |
Unexpected } on line 5: there is no block to close. | There is a } with no matching {. | Delete the extra } or add the { it belongs to. |
Unterminated /* comment starting on line 2. | A /* comment has no closing */. | Close the comment with */. |
Questions people ask
How do I convert SCSS to Sass?
Paste the SCSS and press Convert to Sass. Braces and semicolons are replaced by indentation and the rest of the code is kept. The output is the indented syntax and normally goes in a .sass file.
Is SCSS to Sass conversion lossless?
For meaning, yes: both syntaxes compile to the same CSS. Layout details such as blank lines and line breaks inside a value can change, and rules with no declarations are dropped.
Does it change @mixin to the = shorthand?
No. It keeps @mixin and @include, which the indented syntax accepts. The = and + shorthands are older and less readable, so the output avoids them.
What happens to my // comments?
They are kept. A comment on its own line stays on its own line and a comment at the end of a declaration stays at the end of it. Block comments are kept too, with their continuation lines indented.
Why does the converter drop an empty rule?
A selector with no declarations or children cannot be written in the indented syntax, since it would look like a line with nothing under it. An empty rule produces no CSS, so removing it changes nothing in the output.
About this tool
Converts between the two Sass syntaxes without changing any meaning. SCSS braces and semicolons become indentation, and the output keeps @mixin and @include rather than the short = and + forms. A statement that spans several lines is joined, and a multi-line value is written on one line. Rules with an empty body are dropped, because indented Sass cannot hold one. Comments are kept, and a comment at the end of a line stays there. The result is plain Sass, so it still needs the Sass compiler to become CSS.