YAML Formatter
About this tool
Pasted YAML is parsed as a full document with the yaml library and written back with 2- or 4-space indentation. Because the document structure is kept, comments stay in place.
Mixed indentation and inline { } [ ] collections are normalized to the same style. Lines are not wrapped by length, so long strings stay on one line.
Syntax errors are shown with line and column — usually tab indentation, a missing space after a colon, or misaligned indentation at the same level. Processing happens on this device.
FAQ
Are comments removed?
No. The document structure is kept, so comments remain.
Does key order change?
No. Keys stay in the order you wrote them.
Multiple documents (---)?
It formats one document at a time; split multiple documents and paste them separately.