XML to YAML
Convert XML into readable YAML while keeping attributes and repeated tags.
Add XML and click Convert to see the YAML here.
How XML to YAML works
Converts XML into readable YAML. The root element becomes the top key, child tags become nested keys and the text inside a tag becomes its value.
Your XML is checked first. If it is not well-formed, you see the line and column of the first error. Conversion follows the same rules as YAML to XML, so you can go back and forth.
Input to XML to YAML
- Paste or type XML into the input box, or upload a .xml or .txt file.
- Input must be well-formed XML with one root element. Entity declarations are blocked to keep you safe.
- Indent: 2 spaces (default) or 4 spaces. Change it and the output updates right away.
Output from XML to YAML
- Attributes go under a $ key. Text in a tag that also has attributes or child tags goes under a _ key.
- Tags that repeat with the same name become a YAML list.
- All values are text, so numbers and words like true are shown in quotes. Comments are dropped.
- Copy the YAML, download it as a .yaml file or open it in full screen.