Convert XML to YAML

Paste an XML document to instantly get its equivalent YAML representation, which is easier to read for a configuration file. Attributes become keys prefixed with @, and text becomes a #text key.

Example:

How it works

Some configuration tools (Kubernetes, CI/CD, Ansible…) use YAML while source data sometimes comes from a legacy XML export. Paste your XML and click "Convert": the tool parses the XML tree structure with the browser's native parser, then generates an equivalent indented YAML.

How are XML attributes and text represented in YAML?

Each XML attribute becomes a YAML key prefixed with @ (for example id="1" becomes @id: "1"), and the text of an element that also has attributes or child elements is placed under a #text key. A purely text element with no attribute or child becomes a plain YAML scalar value.

What happens with repeated elements (lists)?

When several child elements share the same name under the same parent (for example several <livre> tags), they are grouped into a YAML list (prefixed with -) rather than duplicated keys, which aren't valid in YAML.

100% local processing: XML parsing and YAML generation run entirely in your browser — your document never leaves your device.