Code / Code formatting

CSS Formatter

Format CSS stylesheets for clarity and consistency.

Workspace

Browser-based

How to use CSS Formatter

Format CSS rules, declarations and nested selectors with predictable indentation and spacing.

  1. Paste CSS into the source editor.
  2. Select Format code.
  3. Copy or download the formatted stylesheet.

Example

Input

h1{color:red;margin:0}

Result

h1 {\n  color: red;\n  margin: 0;\n}

Important to know

Formatting does not validate the browser support of CSS properties or change their runtime behavior.