Converts a YAML document to XML, usually because an older system on the other end only speaks XML. Keys become element names and are made legal where YAML allowed something XML does not.
Keys YAML allows and XML does not
YAML mapping keys can contain spaces and start with digits; XML element names can do neither. Those are renamed, with a count reported. YAML keys can also be numbers or booleans rather than strings —
2026: value — and those become _2026.Lists lose their name on the way across
XML has no concept of an array. A YAML sequence under
ports: becomes repeated <ports> elements as siblings, not a wrapper containing children — so a list of three ports is three elements with the same name, and a list of one is indistinguishable from a plain value. If you are writing XPath or an XSD against the result, that distinction is the thing that will catch you out. Round-tripping back through XML to YAML cannot recover it either, which is why the reverse tool guesses from repetition.Anchors and aliases are expanded, not preserved
YAML lets you name a block with
&defaults and reuse it with *defaults, and merge one mapping into another with <<:. XML has no equivalent, so every reference is resolved and written out in full. A short file that leaned on anchors can therefore produce a much longer XML document than its size suggests, with the shared block repeated at each use. The values are correct; what is lost is the fact that they were meant to stay in step with each other.Questions
- What happens to a multi-document YAML file?
- The documents are combined into an array first, then wrapped in a single root element, since XML permits only one root.
- Why did my key names change?
- YAML allows keys XML does not — ones with spaces, ones starting with a digit, ones that are numbers. Those are renamed to legal element names, and the tool reports how many.
- Are YAML comments carried across?
- No. XML has comment syntax, but the YAML parser discards comments before the conversion sees them, so there is nothing to carry.
- Is my data uploaded anywhere?
- No. The conversion runs as JavaScript inside this tab. Open your browser's Network panel and convert something — you will see no request carrying your data, because there is no server to send it to. You can also turn your Wi-Fi off and convert anyway.