PureDevTools

SCSS to CSS Compiler

Convert SCSS syntax to plain CSS — variables, nesting, mixins, and arithmetic — instantly in your browser, nothing sent to any server

All processing happens in your browser. No data is sent to any server.
CSS Output

CSS output will appear here.

Supported SCSS features

Variables ($var), nesting (up to 3 levels), & parent selector, mixins with arguments (@mixin / @include), basic arithmetic (+, -, *, /), and /* */ block comments. Advanced features like @extend, @each, @if, and %placeholder require the full Dart Sass compiler.

You’ve got a SCSS snippet from a UI library, a coworker’s stylesheet, or a CSS framework’s source. You need the compiled CSS — right now, without installing Node.js, configuring a build pipeline, or running dart-sass. Paste it in, get plain CSS out.

What SCSS Adds Over Plain CSS

SCSS (Sassy CSS) is a superset of CSS — valid CSS is also valid SCSS — with five major additions that make stylesheets easier to author and maintain:

Variables

Store reusable values once and reference them everywhere:

$primary: #3B82F6;
$border-radius: 8px;

.btn {
  background: $primary;
  border-radius: $border-radius;
}

Compiles to:

.btn {
  background: #3B82F6;
  border-radius: 8px;
}

When your brand color changes, you update one line instead of searching and replacing across hundreds of rules.

Nesting

Write rules that mirror your HTML structure instead of repeating parent selectors:

.card {
  border: 1px solid #e5e7eb;

  .card-header {
    font-size: 20px;

    h2 { color: navy; }
  }
}

Compiles to:

.card { border: 1px solid #e5e7eb; }
.card .card-header { font-size: 20px; }
.card .card-header h2 { color: navy; }

The & reference lets you express pseudo-classes and BEM modifiers inline:

.btn {
  color: white;

  &:hover { opacity: 0.85; }
  &-primary { background: blue; }
  &.disabled { pointer-events: none; }
}

Mixins

Named, reusable blocks of CSS that can accept parameters:

@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@mixin shadow($size: 4px) {
  box-shadow: 0 $size 8px rgba(0,0,0,0.12);
}

.hero {
  @include flex-center;
  @include shadow(8px);
}

Arithmetic

Basic math directly in property values — useful for grid calculations and spacing scales:

.grid-item {
  width: 960px / 3;    // → 320px
  padding: 16px * 2;   // → 32px
}

Comments

Single-line // comments are stripped from the output. /* */ block comments are preserved.

Common Conversion Patterns

Design Tokens with Variables

// Input
$spacing-sm: 8px;
$spacing-md: 16px;
$spacing-lg: 32px;

.section { padding: $spacing-lg $spacing-md; }
/* Output */
.section { padding: 32px 16px; }

BEM with & Selector

// Input
.button {
  display: inline-flex;

  &__icon { margin-right: 8px; }
  &--large { padding: 12px 24px; }
  &:disabled { opacity: 0.5; }
}
/* Output */
.button { display: inline-flex; }
.button__icon { margin-right: 8px; }
.button--large { padding: 12px 24px; }
.button:disabled { opacity: 0.5; }

When to Use This Tool vs Full Dart Sass

This tool handles the most common SCSS patterns with a lightweight regex-based converter — nothing is sent to a server, there are no dependencies, and it runs instantly in your browser.

FeatureThis ToolDart Sass
Variables ($var)YesYes
Nesting (up to 3 levels)YesYes
& parent selectorYesYes
Mixins with argumentsYesYes
Basic arithmetic (+, -, *, /)YesYes
// comment strippingYesYes
@extend and %placeholderNoYes
@each, @for, @while loopsNoYes
@if / @else conditionalsNoYes
@use and @forward modulesNoYes
Color functions (darken(), mix())NoYes
calc() expressionsPassed throughYes

Use this tool when: You need quick SCSS-to-CSS conversion for snippets, component styles, or straightforward stylesheets with variables and nesting.

Use Dart Sass when: You have complex control flow, use @use/@forward modules, or depend on color manipulation functions.

Nesting Gotchas

Nesting depth: This converter handles up to 3 levels of nesting. Deeply nested SCSS often indicates specificity problems in the design — if you need 4+ levels, consider restructuring with BEM or utility classes.

& with whitespace: .parent { & > .child } correctly becomes .parent > .child. The & joins without a space when used for BEM modifiers (&-modifier) and with a space when used as a descendant selector.

@media inside rules: Sass supports nesting @media blocks inside selectors (“bubble up” syntax). This converter does not support that pattern — move @media blocks to the top level before converting.

@extend and placeholders: The %placeholder and @extend directives require full AST analysis to implement correctly. They are not supported here. If your SCSS uses them, compile with the Dart Sass CLI first.

How to Use

  1. Paste your SCSS into the left panel
  2. CSS output appears automatically (300ms debounce)
  3. Click Copy to copy to clipboard or Download .css to save the file
  4. Click Load Sample to see a working example with variables, nesting, and mixins

All conversion runs in your browser — no SCSS is uploaded anywhere.

FAQ

Does this support SASS (indented syntax)? No. This tool only handles SCSS (the .scss extension), which uses braces and semicolons like CSS. The older indented .sass syntax uses whitespace-significant indentation and requires the full Dart Sass parser.

Why not include the full Sass.js library? Sass.js is ~2MB compressed. For a static site focused on performance, a lightweight regex-based converter handles 95% of real-world use cases without the bundle cost.

My output looks slightly different — is it correct? Yes. SCSS compilation can produce functionally identical CSS in multiple formats. This tool outputs readable, formatted CSS. A production build pipeline may further minify, autopreffix, or restructure the output.

Can I use this for Tailwind’s SCSS? Tailwind uses PostCSS, not SCSS. Tailwind configuration files (.js/.ts) and the JIT compiler are unrelated to SCSS. If you have SCSS files alongside a Tailwind project, this tool can convert them independently.

Related Tools

More CSS Tools