YAML to XML Converter Online — Free & Private

Turn readable YAML into XML through the same JSON intermediate as the other FastMinify converters. It suits downstream systems that expect SOAP-like envelopes or XSD tooling.

Loading…
YAML → XML for enterprise envelopes
Turns YAML into XML through the JSON step used by the other converters, for XSD and SOAP work.

Developer notes

The conversion follows the rules of JSON → XML. Keys become child elements, never attributes. List items are named after the parent key without its last letter, plus _item, so endpoints gives endpoint_item. Anchors are resolved by the YAML step, so they add nothing to the XML. Only single-document YAML is accepted. Large files are converted in one pass, so split very large inputs when you can.

Use cases

Feed a YAML draft to a system that expects an XML envelope. Generate XML fixtures from readable YAML. Check how a nested mapping becomes elements.

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

Kubernetes deployment

Input

apiVersion: apps/v1 kind: Deployment metadata: name: checkout-api labels: app: checkout spec: replicas: 3 selector: matchLabels: app: checkout template: metadata: labels: app: checkout spec: containers: - name: api image: registry.example/checkout:2.4.1 ports: - containerPort: 8080

Output

<?xml version="1.0" encoding="UTF-8"?> <root> <apiVersion>apps/v1</apiVersion> <kind>Deployment</kind> <metadata> <name>checkout-api</name> <labels> <app>checkout</app> </labels> </metadata> <spec> <replicas>3</replicas> <selector> <matchLabels> <app>checkout</app> </matchLabels> </selector> <template> <metadata> <labels> <app>checkout</app> </labels> </metadata> <spec> <container_item> <name>api</name> <image>registry.example/checkout:2.4.1</image> <port_item> <containerPort>8080</containerPort> </port_item> </container_item> </spec> </template> </spec> </root>

Lists become repeated item elements

Input

service: name: billing-gateway port: 8443 tls: enabled: true minVersion: "1.2" endpoints: - /health - /metrics - /ready

Output

<?xml version="1.0" encoding="UTF-8"?> <root> <service> <name>billing-gateway</name> <port>8443</port> <tls> <enabled>true</enabled> <minVersion>1.2</minVersion> </tls> <endpoint_item>/health</endpoint_item> <endpoint_item>/metrics</endpoint_item> <endpoint_item>/ready</endpoint_item> </service> </root>

Related tools

Check the YAML first with YAML → JSON, export rows with YAML → CSV or write XML from JSON with JSON → XML.

YAML → XML FAQ

What to expect

Are attributes written?

No. Every key becomes a child element.

How are lists written?

Each item becomes an element named after the parent key without its last letter, plus _item, and the parent tag is dropped.

Can I paste several YAML documents?

No. Streams with several documents are rejected, so paste one document at a time.

Is my data sent to a server?

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

Convert YAML to JSON, XML, CSV, TOML, TSV, Properties and INI, in your browser.