SCSS to CSS Converter

Browsers read CSS, never SCSS. Paste your source on the left and the compiled stylesheet appears on the right while you type, with the selector count and output size updating on every keystroke.

SCSS compilation workbench

Try
Output
SCSS

Source

0 linesReady
CSS

Compiled output

0 linesWaiting for compiler
0SCSS lines
0CSS rules
0Selectors
0 BOutput size

Sass never reaches the browser. CSS does.

Variables, nesting, mixins, and loops exist for the people writing stylesheets. No browser parses any of them. A compiler flattens the whole file into ordinary rules first, and what ships is plain CSS. This page runs that compile step in your tab so you read the source and the flattened result side by side.

Type on the left, wait half a second, read the right. The pause keeps a half-finished brace from throwing an error at you mid-keystroke. Nothing uploads anywhere, because the compiler is a WebAssembly build of LibSass running in the same page.

What the compiler does to each feature

FeatureSCSS you writeCSS you getWatch for
Variable$brand: #cd6799The literal hex, everywhere it appearedBaked in at compile time. Runtime theming needs CSS custom properties instead.
Nesting.card { .title { } }.card .titleEvery level adds specificity you pay for later.
Ampersand&:hover, &__title.card:hover, .card__titleThe ampersand glues with no space. A stray space changes the meaning.
Mixin@include button(red)The full declaration block, copied inThirty call sites write thirty copies of the block.
Placeholder@extend %btnOne rule with a grouped selector listOutput lands where the placeholder sits, not where you extended it.
Loop@each $k, $v in $mapOne rule per iterationA twelve-item map writes twelve rules whether you use them or not.
Math$gap * 216pxResolved during compilation. The browser sees a finished number.

The mixin and placeholder rows are the interesting pair. Mixins duplicate a block at every call site. Placeholders write the block once and append selectors to it. Gzip flattens most of the size difference over the wire, so pick on intent: mixins when the block takes arguments, placeholders when the block is byte-identical every time.

Nesting is where the output surprises people

Five levels of indentation read like a tidy outline in SCSS. Compile it and the outline becomes one long descendant selector.

SCSS SOURCE
.card {.body {.list {li {a { color: #cd6799; }}}}}
COMPILED CSS
.card .body .list li a {color: #cd6799;}

That selector outranks nearly anything you write later, and it snaps the moment a component moves in the markup. Two levels is a workable ceiling. Past that, build flat class names with the ampersand rather than stacking descendants.

This page compiles with LibSass, and Dart Sass differs

LibSass was retired in 2020. It froze at the Sass language as it stood then, so a file written against the current Dart Sass module system will not compile here. Four gaps come up most often:

  • @use and @forward fail. The module system never landed in LibSass. Rewrite to @import before pasting, or compile locally.
  • math.div($a, $b) fails. LibSass reads slash division, so write $a / $b in the copy you paste here.
  • Namespaced built-ins fail.color.adjust() and map.get() belong to the module system. Their older global names, adjust-color() and map-get(), work fine.
  • @import "buttons" finds nothing. A browser tab has no project folder. Partials do not resolve, so paste their contents inline.

For one component, a variables file, or a snippet lifted from a tutorial, none of this bites. For a design system built on @use, run the sass CLI on your machine and treat this page as a scratchpad for the piece you are debugging.

Output style changes the bytes, not the rules

Four styles ship with the compiler. All four produce the same selectors and declarations:

  • Expanded puts one declaration per line. Read the output in this mode.
  • Nested indents child rules to mirror the source hierarchy. Useful when you are tracing which SCSS block produced which rule.
  • Compact collapses each rule onto a single line. A middle ground for diffing.
  • Compressed strips whitespace, drops the last semicolon in each block, and shortens some colors. Ship this one.

The size counter under the panes updates with the style, so switching between Expanded and Compressed shows the transfer cost of the file before gzip touches it.

Where this converter stops

  • No source maps. Mapping a compiled line back to its SCSS origin needs a local build with --source-map.
  • No vendor prefixes. Sass has never added them. Run the output through Autoprefixer or PostCSS if you support older targets.
  • No file imports. There is no filesystem behind the page, so multi-file projects have to be pasted as one block.
  • One error at a time. LibSass reports the first failure and stops. Fix it, and the next one surfaces.
  • Main-thread compilation. Past a few thousand lines the pause between typing and output grows noticeable on slower machines.

Before the output goes into a repo

  1. Scan the compiled selectors for depth. Three parts is a smell, five is a bug waiting for a markup change.
  2. Look for the same block repeated at several call sites. A mixin with no arguments usually belongs in a placeholder.
  3. Confirm which colors got baked. lighten($brand, 20%) resolves to a fixed hex. Values meant to change at runtime belong in custom properties, which pass through the compiler untouched.
  4. Run the result through a formatter or minifier to match your project's house style. The CSS Beautifier and CSS Minifier both handle it.

Going the other direction, from a finished stylesheet back into nested SCSS, is a different job with different rules. The CSS to SCSS Converter handles that side.

SCSS to CSS questions that come up mid-compile

Answers on module syntax, partials, output style, and what this page will not do.

How do I convert SCSS to CSS online?

Paste your SCSS into the left pane. Compilation starts after a short pause in typing and the CSS lands in the right pane. Choose an output style, then copy the result or download it as compiled.css.

Does this support @use and @forward?

No. The page runs LibSass, which stopped before the Sass module system shipped. Rewrite module imports as @import statements, or compile with the Dart Sass CLI for a project built on @use.

Why does my @import of a partial fail?

A browser tab has no project folder, so there is no file for the compiler to read. Paste the contents of each partial into the source pane, in the order your project imports them.

Which output style should I ship?

Compressed. It removes whitespace and trims the final semicolon in each block while producing the same rules. Keep Expanded for reading and reviewing, since the selectors are identical either way.

Does nested SCSS produce slower CSS?

Selector matching cost is negligible on modern engines. The real price is specificity and brittleness. A five-level nest compiles to a five-part descendant selector that fights later overrides and breaks when markup moves.

Is my SCSS uploaded to a server?

No. The compiler runs in your browser as WebAssembly. Source and output stay in the page and are gone when you close the tab.