Reformat and normalise YAML indentation and quoting.
The YAML Formatter re-indents YAML so it follows one consistent style. Choose 2 or 4 space indentation and optionally tick Sort keys to put mapping keys in alphabetical order. The input must parse as valid YAML, so it also works as a quick syntax check.
YAML represents structure with indentation, so formatting is more than cosmetics: the indentation is part of the syntax. This formatter parses the text and writes it out again with uniform indentation and consistent list style. That makes diffs smaller and files easier to read. Sorting keys puts mapping keys in alphabetical order at every level, which helps when comparing similar files but changes the order of the content, so use it deliberately. Lists keep their order. Because the document is rewritten, flow collections can be normalised, for example [1,2] becomes [ 1, 2 ]. Comments are kept when keys are not sorted but are lost when Sort keys is on, because sorting works on plain data.
Yes when Sort keys is off. When it is on they are dropped, because sorting rebuilds the document from plain data.
No. Only mapping keys are sorted, at every level. Sequences keep their order.
Not normally, since the same data is written back. Sorting changes the order of keys, and anchors and aliases are expanded when sorting, so review the result.
They are the two common conventions. YAML allows other widths as long as they are consistent.
Yes, each --- document is formatted, but check the --- separators in the output, because without Sort keys a doubled separator can appear.
No. The conversion runs in the page and the text you enter is not sent anywhere.