Format and validate YAML with configurable indent and optional key sorting. Explore structure in an interactive tree or D3 graph. Export as SVG or PNG. Browser-based.
The YAML Formatter is a js-yaml-powered, browser-based tool that instantly formats and validates YAML documents with configurable indentation and optional alphabetical key sorting. It supports multi-document YAML files (separated by `---`), anchor/alias syntax (`&defaults` / `*defaults` / `<<: *merge`), and produces output conformant to YAML 1.1/1.2. After formatting, an interactive Tree View lets you collapse and expand nodes, while the card-based Graph View renders document structure as a hierarchical node graph — exportable as SVG or PNG. All processing runs client-side; your documents never leave the browser.
QDoes this support multi-document YAML?
Yes — files containing multiple YAML documents separated by --- are each parsed and re-serialised individually, then joined with --- separators in the output.
QWhat does 'Sort keys' do?
When enabled, all mapping keys are output in alphabetical order. This is useful for normalising configuration files and reducing diff noise in version control.
QDoes it support anchors and aliases?
js-yaml parses anchors (&anchor), aliases (*alias), and merge keys (<<: *anchor) and resolves them. The output is the fully resolved document, without anchors (noRefs: true).
QIs my YAML sent to a server?
No. All formatting, tree parsing, and graph rendering happens locally inside your browser. Nothing is transmitted to any server.
QWhat is the Graph View?
The Graph tab renders document key-value relationships as an interactive card-based hierarchical node graph — ideal for understanding deeply nested configuration structures at a glance. It can be exported as SVG or PNG.