YAML to XML converter
Convert YAML to XML: config files, anchors and merge keys included, as well-formed XML.
What you get
- Convert YAML to XML online, with anchors, aliases and merge keys expanded and lists written as repeated elements.
- Checked twice: the YAML is read strictly (duplicate keys are errors), and the XML is parsed back and compared with your data.
- Comments, custom tags and data types XML cannot hold are named in the result.
- Private and free: everything runs in your browser, nothing is uploaded, and there is no sign-up.
How each result is checked
- Step 1: Your YAML is parsed strictly as YAML 1.2: duplicate keys and syntax errors are rejected with the line number.
- Step 1: The JSON output is parsed back and compared with the parsed YAML, value by value.
- Step 2: The output is checked for well-formedness with an XML validator.
- Step 2: The XML is parsed back and compared with your data. Because XML has no data types, values are compared as text.
What can't convert exactly
- Anchors (&), aliases (*) and merge keys (<<) are expanded into full copies, because JSON has no references.
- Comments and custom tags such as !Ref are not data, so they are not carried over. You get a warning when this happens.
- Several documents separated by --- become one JSON array.
- XML has no numbers, booleans or null: they are written as text, and null becomes an empty element.
- Keys that are not valid XML names (spaces, leading digits) are renamed, and you are told which.
- A one-item array looks the same as a single value in XML, and empty arrays have no XML form.
Questions
How is a two-step conversion checked?
Your input is converted to JSON first, then to the target format. Each step has its own independent check, and both must pass. The checks of both steps are listed under every result.
Is my data uploaded?
No. Everything runs in your browser, in a background worker. Nothing is sent to a server.
How do I convert YAML to XML online?
Paste your YAML or open a file on the left (or click Example). The XML appears on the right as you type, already checked. Copy it, or download it as a file. Nothing is uploaded.
Can the XML output be wrong?
Every result is checked before it is shown (the checks are listed on this page). If a check fails, the page says "Review needed" and why, instead of presenting the output as correct, and anything that cannot convert exactly is named in the notes.