YAML to XML

Paste YAML and get XML at once, with errors pointed by line and column, then copy or download the result.

loading YAML to XML
About this tool

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

YAMLXML
Extension.yaml, .yml.xml
Media typeapplication/yamlapplication/xml
Commentsyes (#)yes (<!-- -->)
Data typesJSON types plus dates, anchors and aliaseseverything is text (types come from a schema)
Nestingany depth, by indentationany depth, plus attributes
Typical useKubernetes, Docker Compose, CI pipelinesSOAP, RSS, invoices, Office files
SpecificationYAML 1.2.2W3C 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 #text becomes the element text. XML needs one root element, so a list or several top-level keys are wrapped in <root> (list items in <item>), and null is written as xsi:nil="true".
  • Anchors and aliases (&base, *base) are expanded into full copies.

How to convert YAML to XML

  1. Paste your YAML in the input box (the page opens with an example you can replace).
  2. Read the XML on the right; it updates as you type. If something is wrong, the message says the line and column.
  3. Adjust the options if you need: indentation, sorted keys or type detection.
  4. Copy the result or download it as a .xml file.

Example

This YAML input:

# orders service
app:
  name: orders
  port: 8080
database:
  url: postgres://db:5432/orders
  pool: 10
features:
  - pix
  - boleto

becomes 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.

Report a problem