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

LESS to Sass Converter

CV-46

Turn LESS source into indented Sass source. Variables, mixins and nesting carry over, braces and semicolons become indentation, and review notes list anything that cannot convert.

Runs in your browser. Nothing is uploaded.

LESS code

Sass code

How to use it

  1. Paste LESS into the input box, or open a .less file.
  2. Keep review notes on to see unsupported constructs listed at the top.
  3. Choose the indent and press Convert to Sass.
  4. Copy the Sass or download it as a .sass file.

Two conversions in one

First the LESS-only parts are rewritten: @variables become $variables, @{x} becomes #{$x}, mixin definitions become @mixin and calls become @include. Then the result is written in indented syntax, so the braces and semicolons are gone. Statements are kept in order, comments stay, and trailing comments stay at the end of their line.

What it cannot translate

Guards, detached rulesets, @plugin, @arguments, merge properties and JavaScript expressions are not converted. They are left unchanged or commented out and each is listed with its line number in the notes at the top. Check LESS functions like fade() as well, since Sass has its own names.

Order of work after converting

Compile the Sass with the Sass to CSS tool and compare it with the CSS your LESS produced. Rules with an empty body are dropped, because indented Sass cannot hold them. If you would rather keep braces while you migrate, the LESS to SCSS converter does the same translation with SCSS syntax.

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 LESS to Sass?

Paste the LESS and press Convert to Sass. The page rewrites variables, mixins and extends to Sass syntax and writes the indented form. Anything it cannot translate is listed in a comment block at the top.

Is this LESS to SCSS or LESS to Sass?

This page writes the indented Sass syntax, with no braces. The LESS to SCSS converter writes the brace syntax. The two share the same translation, only the final writing differs.

Why are my variables still variables?

The tool converts the source rather than compiling it, so @brand: #0a6 becomes $brand: #0a6 and every use is renamed. That keeps your design tokens intact instead of baking the values into the CSS.

What are the review notes?

A comment block at the top listing each construct that did not convert cleanly, with its line number, such as a guard that was dropped or an extend that behaves differently. Turn the option off if you want clean output only.

Does Sass have an equivalent of LESS guards?

Sass uses @if and @else inside a mixin or function instead. A guard like "when (@a > 1)" is dropped with a note, and you add the @if by hand. There is no automatic rewrite, because the condition logic differs.

About this tool

Reads the LESS source and writes Sass by rewriting its syntax, not by compiling it, so your variables and mixins stay. It converts @variables to $variables, @{name} interpolation to #{$name}, mixin definitions to @mixin, mixin calls to @include, &:extend() to @extend and ~"escapes" to unquote(). A LESS extend without the word all only matches the exact selector, while @extend also matches it inside other selectors, so such a line adds a review note. It cannot convert guards (when), detached rulesets, @plugin, @arguments, merge properties or JavaScript; those are left unchanged or commented out and listed in the review notes at the top. Check LESS functions such as fade() and percentage(), which Sass names differently. Always compile the result and compare it with the original CSS.

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