YAML (a recursive acronym for YAML Ain't Markup Language) is a human-readable data serialization format originally designed by Clark Evans, Ingy dot Net, and Oren Ben-Kiki. It is the standard configuration language for Kubernetes manifests, Helm charts, Docker Compose files, GitHub Actions workflows, GitLab CI pipelines, Ansible playbooks, Serverless Framework, CircleCI configs, and many more tools that need a config format friendlier than XML and more readable than JSON.
This formatter is built on js-yaml, a mature JavaScript port of the YAML 1.2 specification. yaml.load parses any input string into a JavaScript value (object, array, primitive); yaml.dump serializes that value back to canonical YAML with the indent and lineWidth options you choose. Errors throw with a YAMLException carrying the line and column of the failure, which the tool surfaces as the validation message.
Conversion between YAML and JSON is a round-trip through that same in-memory representation. yaml.load(input) parses YAML into JS objects, then JSON.stringify produces JSON. The reverse direction parses JSON.parse and feeds the result to yaml.dump. Because every JSON value is a valid YAML 1.2 value, JSON-to-YAML conversion is always lossless; YAML-to-JSON sometimes loses YAML-specific features like comments, anchors, and tagged types, which JSON cannot represent.
YAML's most famous footgun is the Norway problem. YAML 1.1 (still the version many tools use, including older js-yaml configurations) treats yes, no, on, off, y, n, true, false as booleans — including the case-folded variants. The two-letter ISO code for Norway is NO, so a country list like [NO, SE, FI] silently becomes [false, SE, FI]. js-yaml v4 defaults to YAML 1.2 which only treats true/false as booleans, but if you target tools running on YAML 1.1 you should always quote ambiguous strings.
Indentation is YAML's other classic pain point. The spec mandates spaces, never tabs, and the indent count must be consistent within a block. Two spaces is by far the most common convention; some teams use four. Mixing tabs and spaces, or accidentally indenting a list one space deeper than its parent map, produces parse errors that are sometimes far from the actual line you edited.
Anchors and aliases (& and *) let you reference a value defined elsewhere in the document, useful for sharing common configuration between Kubernetes resources or job definitions. Merge keys (<<: *base) compose maps; the merge-key feature was deprecated in YAML 1.2 but most tools still support it. js-yaml supports both. Multi-document streams (separated by ---) are common in Kubernetes; this tool parses one document at a time, so split a multi-resource file on the --- separator before pasting.
Security-wise, YAML's tagged types (!!python/object, !!ruby/object) have caused real-world remote code execution issues in libraries like PyYAML's yaml.load (use yaml.safe_load instead). js-yaml ships with a safe-by-default schema; the unsafe yaml.load with custom types is opt-in. This tool uses the default safe parsing path, so tagged types referencing language objects are rejected. Even so, treat unknown YAML files like any other untrusted input.
All processing happens locally. The js-yaml bundle is loaded once, the input lives in component state, and parsing and serialization run on the main thread without any network calls.