1001Ferramentas
🔄Converters

CSS to SASS Converter

Convert plain CSS to the indented SASS syntax, without braces or semicolons. Paste your CSS and copy the SASS to modernize your project styling.

Suporta regras planas (sem aninhamento).

No SASS indentado, omita { } e ; e use indentação consistente (geralmente 2 espaços).

/* CSS */\n.btn { color: white; padding: 8px; }\n\n/* SASS */\n.btn\n  color: white\n  padding: 8px

Plain CSS in the indented Sass syntax

The indented Sass syntax, the one behind .sass files rather than .scss, drops braces and semicolons entirely. Converting half a dozen rules by hand is fine; converting forty is not, and a single leftover semicolon is enough to make the compiler complain. Paste CSS on one side and the .sass version appears on the other, with two spaces of indentation per declaration.

Underneath sits a deliberately small parser: it scans selector and block pairs and rewrites each declaration as an indented prop: value line, keeping the colon that indented Sass still requires. That works cleanly for flat rules, and it has no concept of a block inside a block. Feed it a media query: the inner rules convert while the @media line itself drops out of the result with no warning.

So pull media queries out, convert each block on its own, then put the @media line back and indent the content under it. Comments in /* */ get glued to the selector line and need a quick cleanup. The tool also never invents nesting and never promotes a repeated color to a $variable, which stays your call. Copy and clear buttons sit below the output, and no CSS ever leaves your browser.

Frequently asked questions

What is the difference between .sass and .scss?
Only the surface syntax. SCSS looks like CSS, with braces and semicolons; the .sass syntax uses indentation. Both compile with the same Sass implementation.
Will it nest .card .title for me?
No. Selectors come through exactly as written, one per line. Nesting is a manual pass after the conversion.
What happens to @media?
The rules inside it convert, but the @media line is dropped. Convert those blocks separately and reinsert the wrapper by hand.

Related Tools