YAML to XML
Paste YAML and get well-formed XML that is ready to use.
Add YAML and click Convert to see the XML here.
How YAML to XML works
Converts YAML data into well-formed XML. Each key becomes a tag and each value becomes the text inside it. The output starts with an XML declaration and is indented so it is easy to read.
Conversion follows the same rules as XML to YAML, so you can go back and forth. Your YAML is checked first. If something is wrong, you see the line and column of the first error.
Input to YAML to XML
- Paste or type YAML into the input box, or upload a .yaml, .yml or .txt file.
- YAML must have one top key. It becomes the root element. A list or several top keys show an error, so put your data under one parent key.
- Keys must be valid XML tag names. Anchors, aliases and << merge keys are supported.
- Indent: 2 spaces, 4 spaces (default) or tab. Change it and the output updates right away. Files up to 20MB. Everything runs in your browser.
Output from YAML to XML
- A list becomes the same tag repeated once for each item.
- A key named $ holds attributes. For example, $ with id: 1 gives id="1" on the parent tag. A key named _ holds the text of a tag that also has attributes or child tags.
- Empty values become empty tags like <tag/>. Copy the XML, download it as a .xml file or open it in full screen.