What are YAML and XML?
YAML describes the same data as JSON with indentation instead of brackets, allows comments and is the language of most configuration files. XML marks data with opening and closing tags and attributes; it is older than JSON and still the format of SOAP services, RSS, Office files and many government and banking integrations.
Useful when settings written in YAML must reach a Java, .NET or SOAP world that reads XML, for example to generate a Maven or Spring XML fragment.
This page opens the data converter already set to YAML → XML. Paste the text, read the result as you type, then copy it or download it as a file. Errors show the line and the column. Nothing is sent anywhere: the conversion runs in your browser.
YAML vs XML
| YAML | XML | |
|---|---|---|
| Extension | .yaml, .yml | .xml |
| Media type | application/yaml | application/xml |
| Comments | yes (#) | yes (<!-- -->) |
| Data types | JSON types plus dates, anchors and aliases | everything is text (types come from a schema) |
| Nesting | any depth, by indentation | any depth, plus attributes |
| Typical use | Kubernetes, Docker Compose, CI pipelines | SOAP, RSS, invoices, Office files |
| Specification | YAML 1.2.2 | W3C XML 1.0 |
When to convert YAML to XML
- Convert to XML when a SOAP service, a feed or a legacy system expects XML.
- Keep YAML when people will read and edit the file by hand.
What changes in the conversion
- Comments of the YAML file are not carried over: the converter reads the data, and comments are not data.
- Keys starting with
@become attributes and#textbecomes the element text. XML needs one root element, so a list or several top-level keys are wrapped in<root>(list items in<item>), andnullis written asxsi:nil="true". - Anchors and aliases (
&base,*base) are expanded into full copies.
How to convert YAML to XML
- Paste your YAML in the input box (the page opens with an example you can replace).
- Read the XML on the right; it updates as you type. If something is wrong, the message says the line and column.
- Adjust the options if you need: indentation, sorted keys or type detection.
- Copy the result or download it as a
.xmlfile.
Example
This YAML input:
# orders service
app:
name: orders
port: 8080
database:
url: postgres://db:5432/orders
pool: 10
features:
- pix
- boletobecomes this XML, exactly as the converter writes it:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<app>
<name>orders</name>
<port>8080</port>
</app>
<database>
<url>postgres://db:5432/orders</url>
<pool>10</pool>
</database>
<features>pix</features>
<features>boleto</features>
</root>Frequently asked questions
Is my YAML sent to a server?
No. Conversion happens in your browser, so secrets in a config never leave your computer.
Does YAML to XML keep comments?
No. Comments are dropped because the converter works on the data itself. Copy important comments by hand.
What happens to nested data?
YAML nesting: any depth, by indentation. XML nesting: any depth, plus attributes. The structure is kept as it is.