How to use it
- Paste your CSS, or open a .css file.
- Leave Language on CSS and the action on Format (preselected here).
- Choose the indent and line width.
- Copy the result or download formatted.css.
Worked example
.card{display:flex;gap:12px}.card h2{margin:0} becomes two rules on separate lines: .card { with display: flex; and gap: 12px; indented by two spaces, then .card h2 { with margin: 0;.
Formats and limits
| Input | CSS |
|---|---|
| Output | Formatted CSS |
| Engine | Prettier standalone; Terser; CSSO; HTML whitespace/comment minifier with embedded CSS/JS minification |
Limitations
- Formatting does not change values or merge rules; use Minify CSS for that.
- An unclosed brace or a similar error stops formatting until it is fixed.
- There is no SCSS or Less setting; the input is read as plain CSS.
Questions
Can it unminify a .min.css file?
Yes. Prettier puts each rule and declaration on its own line with your indent, so a one-line stylesheet becomes readable again. Removed comments cannot be restored.
Which options are there?
Indent of 2 spaces, 4 spaces or tabs, and a line width of 80, 100 or 120 characters.
Why does it report a syntax error?
Prettier needs CSS it can parse, such as matching braces. The error shows its line and column and no output is produced until it is fixed.
Is my CSS uploaded?
No. The code is processed in your browser and nothing is uploaded.
Privacy
Runs on your device. Files and text are processed in this browser tab and are not uploaded.
This page opens the Code formatter and minifier ready for this task. See the privacy policy for how toolsdocks handles data.