XML to YAML Converter Online — Free & Private

DOMParser checks the XML first, then the result is written as YAML through the same normalization as the other XML converters.

Loading…
XML → YAML for configuration migrations
Reads XML in the browser and writes it as YAML, with attributes as keys and repeated elements as lists.

Developer notes

The conversion goes through JSON: attributes become keys, and text next to attributes goes under _text. XML values are text, but the YAML writer leaves numbers and booleans unquoted, so a YAML reader types them. Double-quote all strings keeps them as text. Comments are dropped, and namespaces can lengthen the key names, so check the YAML before you use it. Split very large files before you convert them.

Use cases

Move an XML inventory to indented YAML for Helm or Ansible work. Review an old Spring or Ant configuration as YAML. Show how XML and YAML express the same structure.

About these options

For CSV output, choose the delimiter, how fields are quoted, the line endings and whether to write a header row. Auto uses a comma in English and a semicolon in French, German and Spanish, as Excel expects. For CSV input, the delimiter is detected on the first line (comma, semicolon, tab or pipe). You choose whether that line holds the column names. JSON output can use 2 or 4 spaces or a single line, with an optional recursive key sort. XML output can be pretty-printed with a chosen indent width. YAML output takes an indent width and a quoting mode for strings. XML comments are dropped, because the conversion goes through a JSON tree.

Examples

Regional service rollout

Input

<?xml version="1.0" encoding="UTF-8"?> <service name="payments" tier="critical"> <region id="eu" active="true"> <host>srv-03.internal</host> <latencyMs>11</latencyMs> </region> </service>

Output

service: name: payments tier: critical region: id: eu active: true host: srv-03.internal latencyMs: 11

Repeated elements become a list

Input

<?xml version="1.0" encoding="UTF-8"?> <inventory> <item sku="A-1"><qty>12</qty></item> <item sku="B-7"><qty>0</qty></item> </inventory>

Output

inventory: item: - sku: A-1 qty: 12 - sku: B-7 qty: 0

Related tools

Check the shape with XML → JSON, turn rows into a spreadsheet with XML → CSV or shrink documents with the XML minifier.

XML → YAML FAQ

Parsing caveats

Why are numbers written without quotes?

XML values are text, but the YAML writer leaves numbers and booleans unquoted. Choose Double-quote all strings to keep them as text.

Can I run XPath transformations?

No. The tool reads a snapshot of the document and does not evaluate XPath.

How are CDATA sections handled?

Their text is read like any other text. Check the result with your YAML consumer.

Is my data sent to a server?

No. The conversion runs in your browser, and FastMinify never receives what you paste.

Convert XML to YAML, CSV, JSON, TOML, TSV and HTML.