Skip to content
Categories
CSS Formatter
Format CSS to make it easier to read.
Overview
- Formats CSS packed into a single line into a readable form with proper indentation and line breaks, using Prettier.
- Unifies line breaks per property and spacing, following Prettier's standard rules, for a consistent style.
- Useful when you want to inspect the contents of built or minified CSS.
Usage
- Enter the CSS you want to format into the text area.
- Click the "Format" button.
- The indented result is displayed below. Use the "Copy" button to copy it to the clipboard.
Example
Input
body{color:red;margin:0}Output
body {
color: red;
margin: 0;
}Use Cases
- Formatting minified CSS output by a build tool into a readable form for debugging
- Formatting another site's CSS into a readable form before referencing it
- Formatting a CSS snippet into a consistent style before including it in a code review
FAQ
Is the CSS I enter sent anywhere?
No. Formatting runs entirely in your browser using Prettier; nothing is sent to an external server.
What happens if a curly brace is left unclosed?
An error message "The CSS format is invalid." is displayed along with details.
Does it support SCSS or LESS?
No. Only standard CSS syntax is supported.
Notes
- Only standard CSS syntax is supported. Meta-languages such as SCSS or LESS are not supported.
- Formatting fails if the CSS is syntactically invalid, such as when a curly brace is left unclosed.
- Formatting very large CSS may make browser processing slow.
Related Tools
Format HTML to make it easier to read.
Format JavaScript to make it easier to read.
Format TypeScript to make it easier to read.