Messy input
.btn{color:#fff;background:#0070f3;padding:8px 16px;border:none}.btn:hover{background:#0059c1}The CSS Formatter beautifies compact or messy stylesheets into clean, consistently indented rules. It places each declaration on its own line, normalizes spacing around braces, colons, and semicolons, and indents nested at-rules like media queries. The tool processes everything locally in your browser, so your styles are never uploaded, making it safe for proprietary design systems and internal component libraries.
CSS (Cascading Style Sheets) describes how HTML elements are presented, controlling layout, color, typography, and responsive behavior. Stylesheets are often shipped minified for performance, which makes them nearly impossible to read. Reformatting CSS restores structure so you can inspect selectors, compare rules, and understand the cascade. Clean formatting also reduces merge conflicts and makes code review of visual changes far more reliable.
The main file is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
.btn{color:#fff;background:#0070f3;padding:8px 16px;border:none}.btn:hover{background:#0059c1}.btn {
color: #fff;
background: #0070f3;
padding: 8px 16px;
border: none;
}
.btn:hover {
background: #0059c1;
}@media (max-width: 600px) {
.container {
flex-direction: column;
padding: 1rem;
}
}.row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
}
.row > .item {
flex: 1 1 auto;
}:root {
--cols: 3;
--gap: 16px;
}
.grid {
display: grid;
grid-template-columns: repeat(var(--cols), 1fr);
gap: var(--gap);
}@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.modal {
animation: fade-in 0.3s ease-out;
}h1,h2,h3{margin:0;font-weight:600}a:hover,a:focus{color:#0070f3}h1,
h2,
h3 {
margin: 0;
font-weight: 600;
}
a:hover,
a:focus {
color: #0070f3;
}@supports (display: grid) {
@media (min-width: 768px) {
.layout {
display: grid;
grid-template-columns: 200px 1fr;
}
}
}The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Paste compact or messy CSS and it beautifies the stylesheet into indented rules.
Each declaration is placed on its own line inside the rule block.
Nested at-rules like media queries are indented to show their scope.
Spacing around braces, colons and semicolons is normalized consistently.
Selectors are separated so you can scan rules and the cascade easily.
Restores structure to minified production stylesheets.
Everything is processed locally in your browser; styles are never uploaded.
Safe for proprietary design systems and internal component libraries.
Copy the beautified CSS to paste straight into your project.
Use it to reduce merge conflicts and ease review of visual changes.
Output
Start typing to auto-process