FormatBentoYAML
YAML formatter & validator
Paste a Kubernetes manifest, a GitHub Actions workflow or a Docker Compose file. It is parsed, checked and re-indented consistently, with comments, anchors and every document in the file kept.
The formatted code lands in this compartment. Ctrl + Enter formats from the keyboard.
Syntax error
Ready. Paste code, open a file or press Sample.
Runs in your browser · nothing is uploadedHow it works
The yaml package parses every document in the stream. Errors such as duplicate keys, bad indentation or an unclosed bracket stop formatting and show the line and column. Valid YAML is printed again with your indent; quote styles, block scalars (| and >), tags like !Ref, anchors (&base), aliases (*base) and merge keys (<<) are kept.
Indent lists under keys indents the - item lines below their key; turn it off for the compact style. Sort keys orders every mapping alphabetically, keeping merge keys first, and refuses if an alias would end up above its anchor.
Questions
Are comments kept?
Yes, comments on their own lines and at the end of lines. A comment between an anchor and its mapping may move to the line above.
Does it handle files with several documents?
Yes. Documents separated by --- (or ended with ...) are formatted one by one, and an error in any of them is reported with its line.
Is the file uploaded?
No. Parsing and formatting run in this tab, which matters for configs that contain hostnames or secrets.