代码、数据与二维码工具

CSS格式化器

在浏览器中处理或呈现css格式化。

优先本地处理无需注册隐私说明 ↗

LOCAL CSS FORMATTING

Beautify or minify CSS

Format a stylesheet in your browser, choose readable or compact output, then copy or download the result.

Up to 200,000 characters. Formatting happens locally in your browser.

The result is generated locally and can be copied or downloaded.

Limits: 200,000 input characters. Braces, brackets, parentheses, comments, and quoted strings must be balanced.

使用步骤

如何使用

  1. Paste CSS up to 200,000 characters into the editor.
  2. Choose pretty or minified output and an indentation width.
  3. Format the stylesheet, review any syntax warning, then copy or download the result.

Readable CSS output

Pretty mode places selectors, declarations, at-rules, and closing braces on separate lines with your selected 2–8 space indentation. Minified mode removes unnecessary whitespace while keeping strings and comments intact.

Local processing with clear limits

Your stylesheet stays in the browser. The formatter reads up to 200,000 characters and reports unbalanced braces, parentheses, brackets, or unterminated strings before producing output.

常见问题

你可能还想知道

Does this upload my CSS?

No. Formatting, copying, and downloading happen locally in your browser.

Does the formatter change CSS values?

No. It changes whitespace around structural punctuation and preserves declaration values, comments, quoted strings, and functions.

Can I format SCSS or Less?

The tool is intended for standard CSS syntax. It preserves many custom property values and at-rule blocks, but it does not compile preprocessors.

What happens when CSS is incomplete?

Formatting stops with a clear warning when braces, brackets, parentheses, or quoted strings are unbalanced.