Less Minifier
Minify Less CSS for production. Remove whitespace and comments.
What Is Less Minification?
Less minification compiles .less source files to CSS and strips all whitespace and comments — producing the smallest possible CSS for production deployment. Browsers can't read Less directly, so Less must be compiled to CSS before serving. Minifying during compilation is the standard production workflow used by Webpack, Vite, and most modern build tools.
Less Minifier Online — What This Tool Does
This free Less minifier compiles .less files to compressed CSS entirely in your browser using the official Less.js compiler. Variables are substituted, nesting is expanded, mixins are inlined, and all whitespace is removed. Output is production-ready CSS browsers can render directly.
How to Minify Less Online
- Paste Less code into the Input pane, or click Upload to load a
.lessfile. - Click Minify — Less.js compiles and compresses in one step.
- The size badge shows Original (Less) and Minified (CSS) byte counts plus percentage saved.
- Click Copy or Download to save as
minified.css.
What Gets Compiled and Stripped?
- Variables (
@primary) — substituted with their values. - Nesting — flattened to descendant selectors.
- Mixins (
.mixin();) — inlined at each call site. - Operations — math, colour functions evaluated.
- Comments — both
//single-line and/* */block comments stripped. - Whitespace — all unnecessary whitespace collapsed.
- @media queries — bubbled to top level, then minified.
How Much Can Less Minification Save?
Typical Less files see 30–50% size reduction from compilation plus minification — Less source is more verbose than equivalent CSS due to nesting and variable declarations. Combined with gzip / Brotli server compression, total transfer savings reach 80%+.
Tips & Tricks
- Never deploy unminified CSS — even small stylesheets benefit from minification on the critical render path.
- Format Less first with our Less Formatter for readable source, then minify for production.
- Combine with CDN gzip / Brotli — multiplicative savings.
- Less.js is slower than Dart Sass — for large stylesheets, modern projects often pick SCSS for build performance. Our SCSS Minifier handles SCSS equivalently.
- Source maps for debugging — production builds typically include source maps so DevTools can show original Less. This tool doesn't generate them; use a build pipeline.
Related Tools
- Less Formatter — beautify Less for development.
- SCSS Minifier — minify SCSS (more popular alternative).
- CSS Minifier — minify already-compiled plain CSS.
- CSS Formatter — beautify minified CSS for debugging.
Is My Code Sent to a Server?
No. Less compilation and minification run entirely in your browser via the Less.js library. Your stylesheet — including proprietary design tokens and brand colours — never leaves your machine.