CSS to LESS Converter
Convert CSS stylesheets to LESS syntax, turning custom properties (--var) into @variables. Modernize your CSS and copy the ready-to-use code.
Turning CSS variables into LESS variables
LESS already accepts plain CSS, so migrating a stylesheet is rarely about rewriting rules. It is about the variables. A modern file full of --brand and var(--brand) compiles fine, and you end up maintaining two variable systems side by side in the same project. This page does the swap: paste the CSS and the same code comes back with @brand where the custom properties were.
It is a surgical find and replace, not a reformatter. Two rules apply: --name: value; becomes @name: value;, and var(--name) becomes @name. Braces, semicolons, comments and rule order pass through untouched, on purpose, because LESS is a superset of CSS and the file has to stay valid. That also keeps the two panes easy to diff line by line before you save anything.
Two things are left for you. The fallback form, such as var(--gap, 8px), is not matched and comes through unchanged, so pick a value yourself. And if the custom properties lived inside :root, they are converted right there, while a LESS variable declared inside a block only exists inside that block: move the @ declarations to the top of the file. A declaration missing its final semicolon is skipped too. Two text areas, no copy button, converting locally as you type.
Frequently asked questions
Does the output still work as plain CSS?
What about variables I change at runtime?
Can it output SCSS instead?
Related Tools
LESS to CSS Converter
Strips LESS @variables and // comments producing approximate CSS suitable for visual checking.
Stylus to CSS Converter
Explains converting Stylus templates (optional braces/colons) into standard CSS with examples.
SCSS to CSS Converter
Strips simple SCSS features (variable declarations and // comments) producing an approximate CSS for inspection.
CSS to SCSS Converter
Adapts CSS to SCSS preserving rules and turning CSS custom properties into SCSS variables when detected.
CSS to Stylus Converter
Convert plain CSS into the concise Stylus syntax, without braces or semicolons. Paste your CSS and copy the Stylus to modernize your project styling.
CSS to SASS Converter
Convert plain CSS to the indented SASS syntax, without braces or semicolons. Paste your CSS and copy the SASS to modernize your project styling.