代码、数据与二维码工具

YAML美化器

在浏览器中处理或呈现YAML美化。

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

LOCAL YAML FORMATTING

Prettify or compact YAML

Parse one YAML document in your browser, choose the output style and indentation, then copy or download the result.

One YAML document, up to 100,000 characters. Spaces are used for indentation.

The result is generated locally. Compact output may use flow brackets and braces.

Limits: one document, 100,000 input characters, 40 nesting levels, and 2–8 spaces per output level. YAML tags or values that cannot be represented safely are rejected.

使用步骤

如何使用

  1. Paste one YAML document up to 100,000 characters.
  2. Choose pretty or compact output and an indentation width from 2 to 8 spaces.
  3. Format the YAML, review any parse error, then copy or download the result.

Readable YAML output

Pretty mode emits a multi-line YAML document with your selected 2–8 space indentation. Compact mode uses flow collections where possible to keep the result short and easy to paste into configuration files.

Clear boundaries and local processing

One YAML document is supported, with a 100,000-character input limit and a maximum nesting depth of 40 levels. Anchors and aliases are resolved by the parser; cyclic data, unsupported values, and malformed indentation produce a clear error. Parsing, formatting, copying, and downloading happen locally in your browser.

常见问题

你可能还想知道

Does this upload my YAML?

No. The YAML is parsed and formatted locally in your browser.

Why does indentation matter?

YAML uses indentation to express nesting. This tool accepts spaces only and limits the output width to 2–8 spaces per level for predictable configuration files.

Can I format multiple YAML documents?

No. Enter one document at a time so the output and error location remain unambiguous.

What happens when YAML is invalid?

Formatting stops and the page shows the parser error, including its line and column when the parser provides them.