Less to CSS Converter
Compile Less to plain CSS entirely in your browser. The converter resolves Less @variable declarations and every place they are used, expands nested rules and the & parent reference into complete selectors, and understands both // line comments and /* */ block comments. Paste a Less file or component, and get standards CSS back ready to ship. There is no build pipeline to install and nothing leaves your machine — the compile runs locally.
How to use the Less to CSS Converter
Paste your Less into the input and press Compile, or just start typing — the CSS updates live. Example loads a snippet with a few @ variables, a nested block, a &:hover and both comment styles; Copy puts the result on your clipboard. Internally the converter strips comments first, collects every @variable declaration, removes those declaration lines, substitutes the values wherever the variables are referenced, and then flattens the nesting into plain selectors.
Variable handling is the part that needs care, because Less overloads the @ sign: @color: #3b82f6; is a variable, but @media, @supports, @import, @font-face and @keyframes are at-rules that must be left alone. The converter recognises those keywords and only treats the rest as variables, so a @media block is preserved and its inner rules are flattened against the surrounding selector. Nesting works as you would expect: a rule nested inside another becomes a descendant selector, and the & parent reference is replaced with the enclosing selector, turning &:hover into .card:hover and &.active into .card.active. Comma-separated selectors are expanded against each parent. The output is formatted with one declaration per line so it is easy to read and diff.
Less, and how it differs from SCSS
Less (Leaner Style Sheets) is a CSS preprocessor in the same family as Sass: it extends CSS with variables, nesting and reusable pieces, then compiles down to the plain CSS a browser can read. Its headline difference from SCSS is the variable syntax. Where SCSS uses a dollar sign ($brand: #3b82f6;), Less uses an at sign (@brand: #3b82f6;). That choice is the source of Less's one notable ambiguity, because CSS already uses @ for at-rules — @media, @supports, @import, @font-face, @keyframes. A Less compiler has to tell a variable like @gap apart from an at-rule like @media, which this tool does by recognising the reserved at-rule keywords and treating everything else with an @name: value; shape as a variable.
Nesting and the & parent reference behave almost identically to SCSS: nest a rule inside its parent to produce a descendant selector, and use & to splice the parent's compiled selector in place for pseudo-classes, modifier classes and combinators. The mental model is the same, only the variable sigil changes, which is why teams moving between Less and SCSS codebases mostly have to retrain their fingers on @ versus $. Less also has its own takes on reuse — mixins are written as .name() calls rather than @include, and it leans on guards and built-in functions — but the variable-and-nesting core is what you meet first.
This converter focuses on that core: variables, nesting, the parent reference and comments, compiled in the browser with no toolchain. It is great for inspecting what a snippet produces, doing a one-off conversion, or learning how Less resolves selectors. It is not a full Less implementation — mixin calls, guards, operations, functions, @import resolution and detached rulesets are out of scope — so a large production project should still build with the real Less compiler. If your goal is simply to flatten or re-nest plain CSS, the CSS nesting converter does that directly.
Common use cases
- Inspecting Less output — see the exact CSS a snippet compiles to without installing the Less toolchain.
- One-off conversions — turn a small Less file into plain CSS for a project that does not use a preprocessor.
- Migrating off Less — get a starting-point CSS file when moving a component away from the preprocessor.
- Resolving variables — expand a chain of
@variablesto the literal colors and lengths they yield. - Learning nesting and & — watch nested rules and parent references flatten into real selectors as you type.
- Sharing portable CSS — hand a teammate plain CSS from your Less source when they cannot run your build.