Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / Converters / XML to YAML Converter

XML to YAML Converter

Paste XML and get the same data as YAML: no closing tags, no angle brackets. Handy when a project moves its configuration from XML files to YAML.

Runs entirely in your browser — nothing you enter here is sent to a server.

Why move from XML to YAML

XML was the default configuration format for a generation of software, and it is verbose by design: every value is wrapped in an opening and a closing tag. YAML carries the same tree with indentation alone. A forty-line XML file commonly becomes fifteen lines of YAML, and the part a person needs to read — the values — is no longer buried in markup.

The conversion is mechanical. Each element becomes a key, nesting becomes indentation and repeated elements become a list. What needs a decision is the part of XML that YAML has no direct counterpart for.

Attributes

Written as keys with a prefix — @enabled: true — next to the element's children. After converting, most people rename them to plain keys.

Repeated elements

Several <logger> elements become one logger: key holding a list.

Types

With type detection on, 8443 and true become a number and a boolean. Turn it off to keep every value exactly as written.

Comments

XML comments are not carried over. Copy the important ones across by hand — YAML comments start with #.

After the conversion

Treat the result as a faithful translation, not a finished file. A tool that reads YAML configuration usually expects its own key names and structure, which rarely match the XML one to one — Spring's application.yml, for example, is not a transliteration of an XML bean file. Convert to see the data clearly, then reshape it to the schema the target tool documents.

Frequently asked questions

Is the conversion lossless?

The data is preserved: elements, attributes, text and order. Comments, processing instructions and the distinction between an attribute and a child element (other than the prefix) are not part of YAML.

How are XML attributes shown in YAML?

As keys prefixed with @, placed alongside the element's child keys. You can choose a different prefix, or rename the keys afterwards.

Why did a value get quotes in the YAML?

Because YAML would otherwise read it as something else — a number, a boolean, or syntax. Quoting keeps the value identical to the XML original.

Can I convert the YAML back to XML?

Yes: convert YAML to JSON, then JSON to XML. The @ prefix on keys turns them back into attributes.

Related free tools

A calculator answers once. Monitoring answers every minute.

Upzilla checks your sites, servers and APIs around the clock and alerts you the moment something breaks. 10 monitors free, no card required.

Start monitoring free →