Category: Developer tools
CSS Formatter
Format or minify CSS locally with 2 or 4 space indentation
Paste CSS to pretty-print it with 2 or 4 space indentation, or minify it to the smallest safe output. Comments are kept when formatting. Runs entirely in your browser.
Formatted in your browser.
.tool-panel {
display:grid;
gap:16px;
padding:16px
}
/* accent border */
.tool-panel .tool-output {
border:1px solid var(--line);
border-radius:8px
}Everything on this page is processed in your browser. Nothing is uploaded.
What this tool does
A CSS formatter re-indents rules and declarations so nested selectors and media queries are easy to scan, while a minifier strips comments and unnecessary whitespace to shrink a stylesheet for production. This tool only reflows whitespace and never evaluates or executes the CSS it is given.
How to use it
- Paste your CSS into the input box, or load the example.
- Choose Format for readable output or Minify for the smallest size.
- Copy the result; formatted output also lets you pick 2 or 4 space indentation.
Privacy
This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.
Frequently asked questions
- Is my CSS uploaded anywhere?
- No. Formatting and minifying happen in JavaScript running in the page, so your stylesheet never leaves your device.
- Are comments kept?
- Formatted output keeps comments on their own line; minified output removes them, matching what most production build tools do.
- Does it validate the CSS?
- No. It only re-flows whitespace and indentation, so it will not catch typos in property names or invalid values.