How do I format code on this page?
Paste code into the left editor or load a file, choose the options you need, and select Format. Review the result on the right, then copy or save it.
CSS Formatter turns minified or inconsistently spaced stylesheets into readable CSS with consistent indentation, braces, selectors, declarations, media queries, and nested at-rules.
Choose tabs or spaces, place opening braces on the same line or their own line, split selector lists, and control spacing between rules. String values, custom properties, comments, functions, and data URLs are parsed without destructive regular-expression replacements.
Minify removes unnecessary CSS whitespace without restructuring rules. Optimize & Minify can also merge and reorganize compatible CSS for a smaller result. CSS formatting and compression run locally in your browser. Use SCSS Formatter for variables, nesting, mixins, functions, and other SCSS syntax.
Paste code into the left editor or load a file, choose the options you need, and select Format. Review the result on the right, then copy or save it.
The input must match the selected language or syntax. Check incomplete statements, unmatched brackets or quotes, and a dialect or mode that does not match the input, then format again.
A code formatter reads language-aware tokens and nested structures, then rewrites indentation, spacing, and line breaks according to a consistent rule set. It does not compile or run the program, so formatting is not a correctness or security check.
Two spaces, same-line opening braces, split selectors, and a blank line between rules are common defaults for web projects. Control indentation, brace style, selector and rule line breaks, then choose formatting, whitespace-only minification, or stronger valid-CSS optimization.