YAML Formatter

This YAML formatter re-formats YAML with consistent indentation (2 or 4 spaces) and block style, quoting only the strings that need it, while keeping comments, anchors and tags, and proves the data is unchanged.

YAML

YAML

Waiting for input

What you get

How each result is checked

  1. Your YAML is parsed strictly as YAML 1.2: duplicate keys and syntax errors are reported with the line.
  2. The formatted output is parsed back and compared with your input: every document, value and type (1 and 1.0 stay different), tag and comment must match.

What can't convert exactly

  • Comments, anchors and aliases (&, *), merge keys, custom tags (!Ref) and every document (---) are kept.
  • Numbers keep their exact text, such as 1.0, 0xff or a 64-bit ID.
  • Strings that YAML 1.1 tools read as booleans, null, numbers or dates (yes, no, on, off, null, 1_000, 2024-01-01) keep their quotes. A comment at the end of a line may move to its own line.

Questions

Is my data uploaded?

No. Everything runs in your browser, in a background worker. Nothing is sent to a server.

Are comments kept when formatting YAML?

Yes. Comments, anchors and aliases, custom tags and every --- document are kept. A comment at the end of a line may move to its own line.

How do I use the YAML Formatter online?

Paste your input or open a file on the left. The result appears on the right as you type, already checked; copy or download it. Nothing is uploaded: the YAML Formatter runs in your browser.