SCSS to SASS Converter

SCSS and SASS are one language written with different punctuation. Paste SCSS below and the braces turn into indentation levels while the semicolons come off. Interpolation, comments and nested property blocks survive the trip, and anything worth a second look gets flagged under the panes.

SCSS to SASS conversion bench

  • Converts as you type
  • Reads strings and interpolation
  • Nothing leaves the tab
Indent
SCSS input.scss
SASS output.sass
0SCSS lines
0SASS lines
0Deepest nesting
0%Character change

Same compiler, same features, different punctuation

Sass ships two syntaxes for one language. The indented syntax came first in 2006 and uses the .sass extension. It borrowed its layout from Haml, so nesting is carried by whitespace and a statement ends where the line ends. SCSS arrived with Sass 3 in 2010 and uses the .scss extension. It kept braces and semicolons so that any valid CSS file is also a valid SCSS file.

Both feed the same compiler. Variables, mixins, functions, control directives, partials and the module system behave identically in either one. A project mixes both freely, since a .sass partial imports into a .scss file without complaint. Converting between them is a reformatting job, not a translation, which is why the panel above finishes the moment you stop typing.

ElementSCSSSASS
Block boundary{ }Indentation
Statement end;End of line
Silent comment// note// note
Loud comment, continuation lines indented
Mixin definition@mixin name@mixin name or =name
Mixin call@include name@include name or +name
Plain CSS pasted inWorks unchangedRejected until reformatted
Multi-line valueAllowedNeeds a backslash or one line

What the converter does to each construction

Four transformations cover almost every line of a stylesheet. The rest of the file passes through untouched.

Braces become depth. Every opening brace pushes one indent level and the matching close pops it. Selectors, at-rules and nested property blocks all follow the same rule.

SCSS in
.card {padding: 1rem;&:hover {border-color: $brand;}}
SASS out
.card
padding: 1rem
&:hover
border-color: $brand

Nested properties keep their colon. The shorthand that splits font-family and font-size under a shared font prefix reads the same in both syntaxes. The trailing colon on the parent stays put, because dropping it would turn a namespace into a declaration with no value.

SCSS in
.title {font: {family: system-ui;weight: 650;}}
SASS out
.title
font:family: system-ui
weight: 650

Interpolation is left alone. This is where find-and-replace scripts fall over. The braces in #{$size} are part of an expression, not a block, so counting braces naively either eats the variable or shifts every line below it one level deeper. The parser here tracks interpolation depth separately and copies the whole expression across as written.

SCSS in
.grid {width: calc(100% - #{$gutter});content: "a { b }";}
SASS out
.grid
width: calc(100% - #{$gutter})content: "a { b }"

The quoted string in that example matters as much as the interpolation. A brace inside quotes belongs to the string value, and a converter that scans for punctuation without tracking quote state will treat it as a block and wreck everything after it.

Multi-line values fold onto one line. SCSS lets a long box-shadow or grid-template-areas spread across lines because the semicolon marks the end. Indented SASS ends the declaration at the newline, so a wrapped value needs joining first.

SCSS in
.panel {box-shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.06);}
SASS out
.panel
box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06)

Long lines are the cost of that fold. If a joined value runs past your line limit, split it again with a trailing backslash, which is the one continuation marker the indented syntax accepts.

Read these lines before you commit the output

The notes panel under the editors lists what the parser had to make a decision about. Four cases come up often enough to name.

The indentation rules a .sass file enforces

The indented syntax is stricter about whitespace than most people expect on first contact, and the errors it raises are worth knowing in advance.

Which syntax is worth the switch

Both compile to the same CSS, so this comes down to how the file gets written and read.

Reasons to move to indented SASS. Files shrink by a noticeable margin once the punctuation is gone, and git diffs stop showing lines that changed only by a brace. A missing semicolon stops being a failure mode. The indentation is enforced rather than agreed on in a style guide, so nesting depth becomes visible at a glance and deep nesting gets uncomfortable to write, which is a useful pressure.

Reasons to stay on SCSS. Pasting a rule from browser devtools or a vendor stylesheet works with no edits, and that alone decides it for many teams. The Sass documentation shows SCSS first, most published snippets and framework sources use it, and editor tooling has had far more attention pointed at the brace syntax. Bootstrap, Bulma and the rest ship .scss, so a project that overrides their variables lives in SCSS anyway.

The honest summary is that indented SASS suits a codebase written from scratch by a small team that agrees on it, and SCSS suits everything else. If you are converting an existing project, convert one partial, live with it for a week, and see whether the team reaches for the copy button or complains about pasted CSS breaking.

Where this converter stops

Questions about the two Sass syntaxes

Indentation rules, what survives conversion, and when the swap is worth doing.

What is the actual difference between SASS and SCSS?

Punctuation. SCSS uses braces to open a block and semicolons to end a declaration, which makes every valid CSS file a valid SCSS file. The indented SASS syntax replaces both with whitespace, so a block is whatever sits one indent level deeper and a declaration ends at the newline. Variables, mixins, functions, control flow and the module system are identical in both, and one compiler handles the pair.

Does converting to SASS change the CSS my build produces?

No. The conversion only rewrites how the source is punctuated. Feed both files to the compiler and the output stylesheets match byte for byte, apart from anything you edited by hand afterwards. Compile before and after and compare the two files if you want proof for a code review.

Why do other converters break on #{$variable}?

Because they count braces without knowing what the braces belong to. Interpolation wraps an expression in braces that have nothing to do with block structure, so a naive scan either strips them and leaves a broken expression, or treats the opening brace as a new nesting level and pushes every line below it one indent too deep. The parser here tracks interpolation and quoted strings separately, which is why a rule containing content with a brace inside it converts correctly.

Are my comments kept?

Yes, both kinds. Silent // comments and loud comments carry across in place. A multi-line loud comment gets its continuation lines indented one level under the opening, because Sass reads a loud comment as finished once a line returns to the parent indent. Comments that relied on column alignment need a look afterwards, and the notes panel says when the file contained one.

Can I mix .sass and .scss files in the same project?

Yes. The syntax is chosen per file by its extension, and imports cross the boundary in either direction. A .scss entry point pulls in .sass partials and the reverse works too. This makes a gradual migration practical, since you convert one partial at a time and the build keeps working throughout.

Why does Sass complain about my indentation after I paste the output?

Almost always mixed tabs and spaces. A .sass file has to use one indent character throughout, and pasting converted output into a file that already used the other one produces a file Sass refuses. Pick the matching option in the indent control above, or reindent the destination file first. The other frequent cause is a jump of two levels at once, which happens when the source SCSS had an unclosed brace.

What happens to a long value split over several lines?

It gets joined into one line. A declaration in the indented syntax ends at the newline, so a wrapped box-shadow or transition list has to sit on a single line or use a trailing backslash to continue. The converter joins and normalizes the spacing between the fragments. If the result runs too long for your style rules, add the backslash continuation by hand.

Should a new project start with SASS or SCSS?

SCSS, in most cases. Pasted CSS works without edits, the official documentation and nearly every published snippet use it, and editor support is deeper. Indented SASS pays off on a codebase written entirely in house by people who agree on it, where the shorter files and cleaner diffs are worth giving up copy and paste from devtools.

Is my stylesheet uploaded anywhere?

No. The parser runs in this page and the conversion happens on each keystroke inside your browser. There is no request to a server once the page has loaded, so disconnect your network and everything above keeps working. Nothing is stored between visits, and closing the tab clears the editor.