LESS Minifier & Beautifier

Format or compress LESS source — @variables, mixins and interpolation all understood. This formats your Less; it does not compile it to CSS.

Only whitespace and comments are ever changed. No LESS token is renamed, reordered or removed, so the output cannot behave differently from your input. That also means the size reduction is smaller than tools which rewrite your code .

Indent
Off by default: conditional comments and build markers look like ordinary comments, so removing them is your call. Note SQL comments can carry real meaning (query hints in some databases live in comments), so check before stripping. A /*! banner comment is always kept, the usual convention for a licence header.

Drop a LESS file here

or or paste below

Up to 4 MB · nothing uploaded

{{ inBytes }}
{{ outBytes }}
{{ status }}

{{ commentWarning }}

Your LESS is tokenized and reformatted entirely in your browser. Nothing you paste or drop is ever uploaded to a server.

Formatting Less source, not compiling it

Variables, mixin calls, guards and operations are all left byte-identical; only whitespace and comments move. Compiling Less means resolving every one of those, which is a different and far larger job than laying the source out readably.

Escaped values are left alone

~"calc(100% - 10px)" is an escaped string, and its contents are treated as a string literal rather than as code. That matters because escaped values usually exist precisely to hold something the compiler should not touch — and by the same reasoning, a formatter should not touch it either.

@{} interpolation

Read as a single unit, so the braces in .@{name}-box are never mistaken for the start of a nested rule. Getting this wrong causes a formatter to indent everything after it inside a phantom block, which is the most common way Less formatting goes visibly wrong.

A note on // comments

They are handled, but remember Less strips them at compile time anyway — they never reach your CSS. Minifying removes them here too; beautifying keeps them on their own line.

Working with SCSS instead?

Use the SCSS Minifier & Beautifier, which handles $variables and #{} interpolation.

Does this compile LESS to CSS?

No. It formats LESS source only — reindenting or collapsing it while leaving variables, mixin calls, guards and values byte-identical. Compiling Less requires resolving all of that, which is a different tool entirely.

Are @variables and @{} interpolation safe?

Yes. @variable declarations and references are ordinary tokens here, and @{name} interpolation is kept as one unit so its braces are never mistaken for a nesting level.

What about escaped values like ~"..."?

The quoted part is a string token, so its contents are never reformatted — which matters because escaped values often contain exactly the characters a formatter would otherwise want to tidy.

What happens to // comments?

Recognised and removed when minifying, preserved on their own line when beautifying. Note that Less treats // comments as source-only, so they would not have reached your compiled CSS anyway.

Is my source uploaded anywhere?

No. Everything runs in your browser.