LESS to CSS Converter
Compile LESS into plain CSS in your browser. Variables, nesting, mixins, guards, operations and colour functions are all supported, and errors are shown with their line number.
How to Convert LESS to CSS
Quick answer: paste your LESS or open a file; the CSS appears below. Copy it or download the .css file.
-
1
Add your LESS
Paste it or open a file.
-
2
Choose options
Adjust the output on the right.
-
3
Check the CSS
Errors show the line number.
-
4
Copy or download
Save it as .css.
What You Get
What Is LESS?
LESS is a style language that extends CSS with variables written with @, nesting, mixins, operations and colour functions. Many themes, admin templates and older front-end frameworks are written in LESS, and like SCSS it must be compiled into CSS for browsers.
What Is CSS?
CSS (Cascading Style Sheets) is the language that styles web pages: colours, fonts, spacing, layouts and animations. Every browser reads CSS directly. Plain CSS repeats selectors and values a lot in larger projects, which is why many developers write in a preprocessor such as SCSS or LESS and compile it to CSS.
Why Convert LESS to CSS?
Many themes, templates and older front-end frameworks are written in LESS. When you only need the CSS, for a quick change, a theme tweak or to move styles to a project without LESS, compiling here is faster than installing a build setup.
How the Conversion Works
The LESS compiler reads your styles and resolves variables, nested rules with &, mixins with and without arguments, guards, maths operations and colour functions such as darken and fade. The result is standard CSS, either neatly expanded or minified. For safety, inline JavaScript in LESS is turned off.
Example
The card sample becomes a .card rule with padding, radius and the mixin's shadow, a .card .title rule, a .card:hover rule with a darker border colour calculated by darken, and a .button rule with padding worked out from the radius.
Tips
Variables in LESS can be defined after they are used, so order rarely matters, but mixins must exist somewhere in the pasted code. Wrap maths in brackets, as in (@radius / 2), which newer LESS versions require.
Who Uses It?
Developers maintaining LESS themes and templates, designers adjusting colours, and anyone converting older projects. Because the code never leaves the device, it is also safe for private and client projects.
Step by Step
Paste your LESS into the input box, drop a file onto it, or press Open File. The CSS appears in the output box straight away and updates as you type, so you can fix errors and see the effect immediately. Adjust the options on the right. When it looks right, press Copy to put the result on your clipboard, or Download to save it as a .css file. Press Sample to see a worked example first.
Using Your CSS
Paste the CSS into a style tag, a stylesheet file linked from your pages, a website builder's custom CSS box or your content system's theme settings. Keep the source file as your master copy and edit that, then compile again, rather than editing the CSS directly, so your variables and mixins stay useful. Minified output is best for live websites; expanded output is easier to read and review.
About the Output
Expanded output puts each rule and declaration on its own line, which is easiest to read, review and edit. Minified output removes every unnecessary space and line break to make the file as small as possible for live websites. Both contain exactly the same styles. If you are learning, compare the compiled CSS with your source line by line to see how variables, nesting and mixins turn into plain rules.
Private, Free and Instant
The converter is free, with no sign-up and no limit beyond the 5 MB text size. Everything runs in your browser, so private source code, client projects and unreleased work are never uploaded or stored. It works on Windows, Mac, Linux and Chromebooks, and on tablets and phones.
LESS to CSS: Compiling Variables and Nesting
LESS extends CSS with variables, nesting, mixins and functions. Browsers only read plain CSS, so LESS must be compiled.
What happens
Variables are replaced by their values, nested rules are flattened into full selectors, mixins are expanded and operations such as @width * 2 are calculated.
For the similar SCSS style, see CSS to SCSS.
Frequently Asked Questions
Questions about LESS to CSS