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.
Waiting for input
What you get
- Format YAML online with 2 or 4 spaces: a YAML beautifier that turns flow style into block style and quotes only the strings that need it.
- Keeps what other formatters drop: comments, anchors and aliases, custom tags such as !Ref, every --- document, and number text like 1.0 or 0xff.
- Checked: the formatted YAML is parsed back and every document, value, type, tag and comment compared with yours.
- Duplicate keys and syntax errors are reported with their line.
- YAML pretty print for any .yml file: a YML formatter for configs, Kubernetes manifests and workflows.
- Private and free: everything runs in your browser, nothing is uploaded, and there is no sign-up.
How each result is checked
- Your YAML is parsed strictly as YAML 1.2: duplicate keys and syntax errors are reported with the line.
- 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.