XML to YAML Converter
Paste XML and get YAML — element names become mapping keys, attributes get an @ prefix, and repeating siblings are automatically serialized as sequences.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is XML to YAML Converter?
YAML is often preferred over XML for configuration and data files because it is more readable. Converting XML to YAML manually requires mapping each element to a key, lifting attributes, and wrapping repeated siblings in a sequence — all of which is mechanical but error-prone.
This tool uses the browser DOMParser to parse the XML, then walks the DOM to produce a JSON-compatible value, and finally converts that to YAML. Attributes are preserved with an @ prefix. Repeated sibling elements with the same tag name become YAML sequences. Text nodes coexist with attributes under the #text key.
How to Use XML to YAML Converter
Paste XML into the input panel.
Set the indentation.
Copy the YAML output.
Common Use Cases
- Converting an XML configuration file to YAML for a tool that prefers YAML.
- Migrating Maven pom.xml data to Gradle or Helm values YAML.
- Transforming an XML API response to YAML for inspection or documentation.
- Learning the structural difference between XML and YAML representations.
Example Input and Output
An XML document converts to an equivalent YAML structure.
<config><host>localhost</host><port>8080</port><debug>true</debug></config>config:
host: localhost
port: '8080'
debug: 'true'Privacy
All XML parsing and YAML generation happen in your browser. No content is sent to a server.
String values
All XML values are strings. Numbers and booleans will appear quoted in YAML. Convert the YAML further with the YAML to JSON tool to coerce types.

