Skip to content
yutils
Example

Input (minified CSS)

.btn{padding:8px 16px;border-radius:6px;background:#5b21b6;color:#fff}.btn:hover{background:#4c1d95}

Output (formatted)

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  background: #5b21b6;
  color: #fff
}

.btn:hover {
  background: #4c1d95
}

Note

Selectors, media queries, and @keyframes all get indented. CSS-in-JS inline styles require a different tool.

Usage / FAQ

When to use

  • Restore readability for minified CSS bundles (Tailwind, CSS-in-JS, …)
  • Tidy CSS before pasting into issues or Slack
  • Visualize nested rules: media queries, @keyframes
  • Indent one-liner CSS produced by an AI
  • Use minify mode for a first-pass production compress

FAQ

Q.Does selector or property order change?
A.Not in format mode — only whitespace and indentation change. Minify mode makes changes that keep the meaning: it shortens values (blue → #00f, 0.5 → .5), reorders properties within a rule, removes declarations that a later one overrides, and merges neighboring rules with identical contents.
Q.Does it support CSS nesting?
A.Both formatting and minifying do. Minifying keeps nesting as it is instead of flattening it — nested rules such as &:hover and range media queries (@media (width >= 600px)) stay in the result.
Q.Does it handle SCSS or Less?
A.Formatting is best-effort for plain CSS, so SCSS / Less-only syntax such as variables, @if, or mixins may come out wrong. Minifying leaves out anything it can't read as standard CSS (SCSS variables such as $x: …) and shows where, while unknown at-rules such as @mixin are kept as they are. Compile SCSS to CSS before minifying.
Q.Does minifying change prefixes like -webkit-?
A.Minified output targets browsers from about 2021 on (Chrome / Edge 90, Firefox 88, Safari 14 and later). Prefixes those browsers still need are added (-webkit-backdrop-filter next to backdrop-filter), and old prefixes they don't need (-moz-user-select and the like) are removed. Fallbacks placed before newer values they don't understand (the first of height: 100vh; height: 100dvh) are kept. Some properties such as display and overflow keep only the last value even with a fallback (overflow: hidden; overflow: clip → clip), so check the result if you rely on such a fallback.
Q.Is my CSS sent anywhere?
A.No. Everything runs in the browser. The first time you pick minify mode, the minifier engine (lightningcss, WebAssembly) is downloaded from this site, but the CSS you enter is never sent anywhere.
Fun facts
  • CSS was first proposed to the W3C in 1994 by Norway's Håkon Wium Lie (at CERN at the time, later CTO of Opera). Together with Bert Bos, he finalized CSS Level 1 in 1996. The simple idea of 'separate document structure (HTML) from presentation (CSS)' became the standard paradigm of web design.

    W3C — CSS
  • Starting with CSS3, the spec stopped being a single document and became **modular** — Selectors Level 4, Grid Layout, Flexbox, and the rest each evolve independently. That's why 'CSS4' doesn't officially exist — every module carries its own version.

    W3C — CSS current work
  • During the late-1990s 'browser wars,' IE and Netscape raced to ship non-standard CSS extensions, making compatibility a nightmare. One reason CSS's cascade and specificity rules look so complex today: they handle the chaotic diversity of that era consistently.

    Wikipedia — Browser wars