Format Code Now
/
ConvertSCSS to LESS Converter Next: SCSS to Sass Converter ›

SCSS to LESS Converter

CV-54

Rewrite SCSS source as LESS source. $variables become @variables, @mixin becomes a LESS mixin, @include becomes a call, and the Sass features LESS has no match for are commented out and listed.

Runs in your browser. Nothing is uploaded.

SCSS code

LESS code

How to use it

  1. Paste your SCSS into the input box, or open a .scss file.
  2. Leave review notes on so unsupported items are listed at the top.
  3. Pick the indent and press Convert to LESS.
  4. Copy the LESS or download it as a .less file.

What converts

$color: red becomes @color: red, and #{$name} becomes @{name}. "@mixin box($w, $h: 2px) {}" becomes ".box(@w, @h: 2px) {}", and "@include box(1px);" becomes ".box(1px);". @extend .a becomes &:extend(.a all), which matches how Sass extends. Nesting, @media, & suffixes and comments carry over as they are.

What LESS cannot take

@if, @else, @each, @for, @while, @function, @return, @use, maps, %placeholders, @content and nested properties have no LESS counterpart. They are commented out with // and each one is listed with its line number in the notes. !default and !global flags are removed, and Sass module functions such as math.div are flagged.

Check the result

Because the source is rewritten rather than compiled, variables and mixins stay in place. Compile the LESS with the LESS to CSS tool and compare it with the SCSS to CSS output. A commented-out block means that logic is missing from the LESS until you rewrite it with guards or mixins.

Error messages and what to do

MessageWhat it meansFix
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 */.
Unexpected { with no selector before it, on line 4.A { appears with nothing before it to name the rule.Add a selector before the { or remove it.

Questions people ask

How do I convert SCSS to LESS?

Paste the SCSS and press Convert to LESS. Variables, mixins, includes and extends are rewritten into LESS syntax, and a note block at the top lists the Sass features that had no LESS equivalent.

What happens to @if, @each and functions?

LESS has no direct equivalent, so the blocks are commented out and listed in the notes. You rebuild them with LESS guards, mixin recursion or plain CSS. Nothing is silently dropped.

Why was !default removed?

LESS has no conditional variable assignment, so the flag cannot be kept. The tool removes it and adds a note. The variable then always takes the value written, which matters if you relied on overriding defaults.

Are Sass maps supported?

No. A map such as $theme: (a: 1) is kept as a comment with a note, because LESS handles that kind of data with mixins or detached rulesets instead. Convert the values to separate variables by hand.

Will the LESS compile to the same CSS?

For variables, nesting, mixins and extends, yes, which you can confirm by compiling both. Where a feature was commented out, the CSS from that part will be missing, so read the notes first.

About this tool

Reads the SCSS source and writes LESS by rewriting its syntax, not by compiling it, so your variables and mixins stay. It converts $variables to @variables, #{$name} to @{name}, @mixin to a .mixin() rule, @include to a mixin call and @extend to &:extend(... all), which matches how Sass extends. Sass-only features have no LESS match: @if, @each, @for, @function, @use, maps, %placeholders, @content and nested properties. Those are commented out and listed in the review notes. !default and !global flags are removed. Compile the result and compare it with the original CSS.

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