When is YAML Formatter useful?
YAML is easy to read and easy to break. A single tab, an indent that is two spaces on one line and three on the next, or a list item that lost its dash is enough to produce a file that looks fine and parses into something else entirely. A formatter normalizes the structure so indentation is consistent and the shape of the document is visible at a glance. This page parses the YAML in the browser, reports the line number when it cannot, and writes the result back with two-space indentation. The document never leaves the tab.
The formatter works from the data rather than from the text. The document is parsed into a structure and then written back, so indentation is uniform by construction and cannot drift between lines. Keys keep the order they had in the source, nested mappings gain two spaces per level, and lists are written with a dash and a space. A tab anywhere in the file is rejected with its line number before parsing begins, because YAML forbids tabs as indentation and a parser would otherwise fail somewhere far away from the real cause.
Two things are lost by design. Comments and blank lines do not survive, because they are not part of the data, so a heavily commented file should be formatted only to check that it parses. Anchors, aliases, and custom tags are outside the supported subset and are reported rather than silently dropped, which means a file that depends on them needs a full YAML library. Validation stops at the first structural error and names the line: inconsistent indentation, a list that is not under a key, a mapping entry without a colon, or an empty list item. Everything runs in the tab, so a manifest or a CI file that carries credentials can be checked and tidied without being sent to a server, and the original file on disk stays untouched until you save the result yourself.