XML to YAML Converter

Turn XML into YAML, the format most modern configuration and CI systems expect, using the same mapping rules as the JSON converter.

XML
YAML
Runs locally in your browser

About the XML to YAML Converter

Older tooling speaks XML; newer tooling speaks YAML. Moving a configuration from a Spring XML file, a Maven POM or an Ant build into a YAML-based system usually starts with a mechanical conversion, then hand editing. This tool does the mechanical part: elements become mappings, attributes become keys with a prefix, repeated elements become sequences, and text-only elements become scalar values.

The output is YAML 1.2 in block style with two-space indentation, which is what Kubernetes, GitHub Actions and Docker Compose read. Strings that YAML would otherwise treat as numbers or booleans are quoted so the data does not change type on the way through. Key order follows the XML document order.

If you need a JSON intermediate, use XML to JSON; the two tools share the same conversion logic so the structures match. The reverse converter is available for the round trip.

How to use

  1. Paste XML on the left.
  2. Adjust the attribute prefix if your target system dislikes the @ character.
  3. Copy the YAML and edit any keys the target schema names differently.

Common questions

How are repeated elements shown?
As a YAML sequence (a list with leading dashes) under the element name.
Where do attributes go?
They become keys with the prefix you set, inside the mapping for their element.
Does it keep comments?
No. Comments are not carried across because they have no position in the data model.