An SCSS beautifier makes nested selectors, variables, mixins, and directives easier to review by applying consistent indentation and line breaks. This tool can also create a compact version of the same SCSS source when you need to preserve Sass syntax rather than generate CSS.
This page is a formatter, not a Sass compiler. Beautify uses the CSS formatter from js-beautify, while Minify uses ParseCode's own comment and whitespace helper. Neither mode evaluates variables, expands nesting, runs mixins or functions, resolves modules, or produces browser-ready CSS.
How to Use the SCSS Beautifier and Minifier
Choose a readable layout or a compact SCSS source representation.
- Select Beautify or Minify from the Action control.
- In Beautify mode, choose 2 spaces, 4 spaces, or Tab from Indent.
- Paste or edit SCSS in Source code; Output updates after a short pause.
- Check the status for the source and output byte counts; Minify also reports the calculated percentage reduction.
- Select Copy to copy Output.
- Select Use output as input to replace Source code with the current result and process it again.
What SCSS Formatting Changes
SCSS is the CSS-compatible syntax of Sass. It adds features such as variables, nested rules, mixins, interpolation, functions, and module directives while retaining braces and semicolons. Formatting changes the layout of those constructs, not what a Sass implementation is intended to calculate.
$brand: #1d4ed8;
@mixin button($color: $brand) {
background: $color;
&:hover {
color: white;
}
}
Beautify passes the source to js-beautify's CSS formatter with the selected indentation. It does not invoke the official Sass parser. Common CSS-like blocks and nested selectors can format cleanly, but readable output is not evidence that the source compiles or that the formatter understood an unusual Sass construct.
The formatter is configured not to add a final newline and to preserve no more than two consecutive line breaks. A repository may enforce different conventions through its formatter or linter, so use this result as a working draft when project-specific rules matter. For ordinary stylesheets, use the CSS beautifier; for LESS syntax, use the LESS beautifier.
What SCSS Minification Does and Does Not Do
Minify removes ordinary /* ... */ block comments, // line comments, repeated whitespace, and optional spaces around a limited set of punctuation. It also removes a semicolon immediately before }. Quoted strings, simple url(...) contents, and block comments beginning with /*! are temporarily protected so their contents are not altered by that cleanup.
The result remains SCSS. The helper does not substitute $variables, expand @include directives, evaluate functions such as darken(), flatten nested rules, load @use or @forward modules, remove unused selectors, or optimize equivalent CSS values. If the destination is a browser, compile with a Sass implementation first and test the generated CSS.
This minifier is a lightweight scanner rather than a full SCSS grammar parser. It recognizes quoted strings and a simple url(...) form, but it does not validate the surrounding syntax or prove semantic equivalence for unusual constructs. Review compact output carefully when it contains interpolation, complex custom functions, escaped content, or other syntax that depends on precise token boundaries.
The Indent control is disabled in Minify mode because compact output does not use the selected indentation. The reported reduction compares the browser Blob byte sizes of Source code and Output, then rounds the percentage. It is not a gzip or Brotli estimate, and it says nothing about the size of CSS after Sass compilation.
Comments, Edge Cases, and Common SCSS Mistakes
SCSS supports loud block comments and silent // comments. In this tool's Minify mode, ordinary block and line comments are removed, while a block comment beginning with /*! is retained. Comment-like characters inside a protected quoted string or url(...) value remain part of that value rather than being treated as a comment.
Do not treat formatting as syntax validation. An unmatched brace, an undefined mixin, a misplaced module directive, or invalid interpolation may still produce Output because the beautifier is arranging text rather than compiling a program. Run the project's Sass compiler and tests to find language and integration errors.
Be cautious with division, calculations, and whitespace-sensitive token boundaries. Sass language behavior evolves, and code that resembles CSS can still have Sass-specific meaning. A compact result should be compared with the original and compiled in the same environment used by the project before it replaces maintained source.
Large formatting-only changes can also hide behavioral edits in review. Keep reformatting separate from selector, token, or component changes where possible, and inspect the result with the text diff checker before adopting it.
Privacy and Security When Formatting SCSS
Formatting and minification run locally in the browser; the SCSS text is not uploaded for processing. The generated source is displayed in a read-only textarea and is not injected into the page as an active stylesheet. That prevents the tool itself from applying selectors, imports, or URLs found in the input.
Local processing does not make the source non-sensitive. SCSS can expose internal asset hosts, unreleased design tokens, customer names, comments, or embedded data. Clipboard managers, browser extensions, screenshots, and the place where you paste the result are separate exposure paths, so redact confidential values before sharing output.
Minification is not sanitization. It does not inspect remote imports, remove dangerous URLs, identify secrets, or make untrusted SCSS safe to compile and publish. Treat copied output as source code, review its provenance, and apply the controls of the build system that ultimately resolves dependencies and emits CSS.
Frequently Asked Questions
Does this tool compile SCSS into CSS?
No. Beautify applies js-beautify's CSS formatter to the SCSS source, and Minify removes selected comments and whitespace while retaining Sass syntax. Use a Sass compiler when you need CSS that a browser can load.
Does Beautify validate SCSS syntax?
No. The page does not run a Sass parser or compiler, so formatted output may still contain invalid variables, interpolation, mixin calls, or module directives. Compile the result and run project checks when correctness matters.
Which comments does Minify preserve?
It preserves block comments that begin with /*!. Ordinary /* ... */ comments and // line comments are removed, while comment markers inside protected quoted strings or url(...) contents remain part of those values.
Why is Indent disabled in Minify mode?
Minified output removes optional layout whitespace, so two-space, four-space, and tab indentation would not affect the compact result. Switch to Beautify to apply one of the available indentation styles.
Is my SCSS source uploaded?
No. Formatting and compacting happen in the browser, and the source is not sent to a formatting endpoint. Sensitive code can still be exposed through extensions, clipboard history, screenshots, or later sharing, so remove secrets and private data when possible.
References: Sass documentation: Syntax · js-beautify documentation.