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

Sass to LESS Converter

CV-50

Rewrite indented Sass as LESS source. $variables become @variables, mixins and includes become LESS mixins and calls, and Sass-only features are commented out and listed.

Runs in your browser. Nothing is uploaded.

Sass code

LESS code

How to use it

  1. Paste your indented Sass into the input box, or open a .sass file.
  2. Keep review notes on to list unsupported items.
  3. Pick the indent and press Convert to LESS.
  4. Copy the LESS or download it as a .less file.

Parse, then rewrite

The indentation is turned into blocks first, with = and + read as @mixin and @include. Then the Sass-specific syntax is rewritten: $gap: 8px becomes @gap: 8px, "@include box(1px)" becomes ".box(1px);", @extend .a becomes &:extend(.a all) and #{$x} becomes @{x}. The result is brace-based LESS.

Limits

@if, @each, @for, @function, @use, maps, %placeholders, @content and nested properties have no LESS counterpart. They are commented out and listed in the notes. !default and !global are removed. A Sass module call such as math.div is flagged. The input must use one consistent indent or it stops with a line number.

Verify

The conversion is of the source, so variables and mixins stay. Compile the LESS with the LESS to CSS tool and compare it with the Sass to CSS output. A commented-out block means that behaviour is missing from the LESS until you rebuild it.

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

Paste the indented Sass and press Convert to LESS. The page reads the indentation, rewrites variables, mixins and extends into LESS and writes braces and semicolons. A note block lists any construct that did not convert.

Is the input Sass or SCSS?

Indented Sass, the syntax without braces. If your file uses braces and semicolons, use the SCSS to LESS converter instead, which reads that form and gives the same kind of LESS output.

How are + and = mixins handled?

They are read as @include and @mixin, so "=box($w)" becomes ".box(@w) {" and "+box(1px)" becomes ".box(1px);". Mixin bodies keep their declarations and nesting, and default values are kept too.

Why is my @function in a comment?

LESS has no @function, so the block is kept as a // comment and listed in the notes. Replace it with a mixin that returns values through variables or with plain CSS.

Does it compile my Sass first?

No. It converts the source, so your variables and mixins remain as variables and mixins in the LESS. Use the Sass to CSS compiler on this site if you only need the finished CSS.

About this tool

Parses the indented Sass, then rewrites it as LESS without compiling, so variables and mixins stay: $variables become @variables, @mixin becomes a .mixin() rule, @include or + becomes a mixin call, and @extend becomes &:extend(... all). Sass-only features with no LESS match (@if, @each, @for, @function, @use, maps, %placeholders, @content) are commented out and listed in the review notes. !default and !global are removed. The input must use one consistent indent. Compile the result and compare it with the original CSS.

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