YAML to XML Converter

Convert YAML mappings and sequences into well-formed XML, choosing the root and item element names.

YAML
XML
Runs locally in your browser

About the YAML to XML Converter

Some systems still ingest only XML: legacy SOAP services, Java configuration, certain enterprise import formats. When the source of truth is a YAML file, this converter produces the XML equivalent. Mappings become nested elements, sequences become repeated elements named by the item name you choose, scalars become text content, and nulls become empty self-closing elements.

Key names that are not valid XML element names, for example keys with spaces or leading digits, are rewritten with underscores. Text is escaped so ampersands and angle brackets in values are safe. YAML has no notion of attributes, so no attributes are produced; if the target format expects them, adjust the result in the XML Formatter.

The conversion goes through the same object model as YAML to JSON, so anchors are resolved and multi-line strings are joined before the XML is built.

How to use

  1. Paste YAML on the left.
  2. Set the root element and the name for list items.
  3. Copy the XML or download it.

Common questions

How is a YAML list represented?
As repeated elements. A top-level list uses the item name from the toolbar; a list under a key repeats that key.
Can YAML keys become attributes?
No; there is no information in YAML to decide which keys should be attributes, so all become child elements.
Is the XML declaration added?
Yes, the output begins with the standard UTF-8 declaration.