YAML anchor expander
Replace YAML anchors, aliases and merge keys with the full content they point to.
YAML anchor expander
Paste a YAML document that uses anchors (&name), aliases (*name) or merge keys (<<:) and this tool replaces every reference with the full content it points to. The result is plain, self-contained YAML with no anchors, aliases or merge keys left — useful when you need to hand a config file to a tool that doesn't understand YAML's reuse syntax, or when you just want to see what a heavily-anchored file actually expands to.
Merge keys are resolved with the same precedence YAML itself uses: a key written explicitly in a mapping always wins over one pulled in through a merge, and when a mapping merges more than one source (<<: [*a, *b]), the earlier source wins on a collision. Chained merges — a mapping that merges another mapping which itself merges a third — are followed all the way down. Multiple documents in one input, separated by ---, are each expanded independently and rejoined with the same separator.
The options control the shape of the output rather than what gets expanded. "Preserve key order" keeps keys in their original order; turning it off sorts each mapping's keys alphabetically. "String style" can force every string value to double or single quotes, without touching numbers, booleans or nulls. "Remove unused anchors" drops a top-level key that only exists to define an anchor nobody ever references — dead scaffolding some hand-written YAML accumulates over time. "Highlight mode" swaps the expanded YAML for a short report listing every anchor, where it's defined, and every line that uses it via an alias or a merge — handy for understanding a file before you flatten it.
Everything runs locally in your browser — your YAML is never uploaded or sent to a server, which matters since anchors and merge keys are common in files that hold environment configs, CI pipelines or Kubernetes manifests. Copy the result, download it as a .txt file, or send it straight into another tool such as YAML to JSON.