YAML Tools
Format, validate, and parse YAML configuration files.
Format and validate YAML with 2-space or 4-space indentation.
Validate YAML syntax against the YAML 1.2 spec.
Parse YAML and inspect the resulting document structure.
YAML reads better than JSON for anything a human edits by hand — Kubernetes manifests, GitHub Actions workflows, docker-compose files — which is exactly why it's the default for configuration and the source of a specific kind of bug JSON can't produce: whitespace that's structurally significant. Two spaces of indentation instead of four silently changes which key nests under which, and there's no closing brace to catch the mistake.
Formatter normalizes indentation (2-space or 4-space) and re-serializes the document, which also has the side effect of catching structural errors that display in a text editor but wouldn't survive a real YAML parser. Validator checks a document against the YAML 1.2 spec and reports the exact line and column of the first failure — useful when a manifest fails to apply and the CLI error is unhelpfully generic. Parser takes that further, showing you the structure YAML actually resolved to, which matters because YAML's implicit typing (an unquoted yes becomes a boolean, an unquoted 1.0 becomes a float) occasionally resolves a string you meant literally into a different type entirely — the classic "Norway problem" where a country code NO becomes false.
These tools are built on js-yaml, which supports the YAML 1.1/1.2 feature set most real-world files use — anchors, aliases, multi-document streams, block and flow styles — but doesn't attempt custom tag resolution or language-specific extensions some YAML libraries add (Ruby's !ruby/object, for instance). If a file was authored against one of those extensions, it will round-trip through this parser as plain scalars rather than fail, which is usually what you want but is worth knowing going in. For the JSON↔YAML direction specifically, see the Converters category — key order is preserved, but YAML-only features like anchors and comments don't survive a trip through JSON, since JSON has no equivalent to reconstruct them from.