ToolFeather
Developer / SEORuns in your browser

XML to YAML Converter

Convert XML to clean, readable YAML: attributes become @keys, repeated elements become lists, and any string YAML might misread — yes, no, 1.0, dates — is quoted for you.

Quick presets

XML to YAML Converter

XML
YAML

Runs in your browser — nothing you enter is uploaded or stored.

ToolFeather · XML → YAML
Scratchpad auto-saved
Stored in this browser (localStorage)
Step-by-step~40s read

How it works — in four simple steps

No signup and nothing to install — it all runs in your browser.

1

Add your XML

Paste it into the left box, press Open file, or drag a .xml file onto it. Sample loads a realistic example.

2

Set the options

Adjust the options above the boxes — the output updates instantly as you change them.

3

Check the result

Read the status line: it reports rows, keys and any value that couldn't be represented in YAML.

4

Copy or download

Copy the YAML or download it as a .yaml file. Nothing was uploaded at any point.

Pro tip

Untick Detect numbers when values like versions (1.10) must stay exactly as written.

Features

Attributes kept, clearly marked

XML attributes become keys with an @ prefix (or _ / - / none), so they never collide with child elements of the same name.

Real types, not just strings

Numbers, booleans and empty values are detected — while codes with leading zeros such as 00742 or +44 phone numbers stay text.

Namespace control

Keep prefixes like dc:title, or strip them to get plain keys when the namespaces don't matter to you.

Stable array shape

Optionally make every child element an array, so code doesn't break when a list happens to have only one entry.

Document marker

Optionally start the file with --- for tools that expect an explicit YAML document.

Private by design

Parsing and conversion run in your browser with JavaScript — your data is never uploaded, logged or stored.

About the XML to YAML Converter

Teams moving configuration from XML (Maven, Spring, .NET app.config, Ant) to YAML (Kubernetes, GitHub Actions, Docker Compose, Spring Boot's application.yml) usually want the same data with less noise. This converter parses the XML into a tree using the same rules as our XML to JSON tool — attributes as @keys, repeated elements as lists, text-with-attributes in #text — and writes that tree as block-style YAML.

The YAML writer is careful about the values YAML parsers interpret on their own. Strings such as yes, no, on, off, null, anything that looks like a number, a date like 2026-10-21 or a time like 12:30 are quoted, so they stay strings in every parser — including the YAML 1.1 parsers still used by PyYAML and many CI systems. Keys starting with @ are quoted too, because @ is reserved in YAML.

Longer multi-line text is written as a | block scalar, which keeps line breaks exactly; short multi-line values are written as a quoted string with . XML comments are dropped since they aren't part of the data model.

Examples

A small XML configuration with attributes, a repeated element, a boolean-looking value and a multi-line message.

XML input
<config env="prod">
  <app>
    <name>billing</name>
    <version>1.10</version>
    <enabled>yes</enabled>
  </app>
  <server host="db-1" port="5432"/>
  <server host="db-2" port="5432"/>
  <banner>Welcome to billing.
Unauthorised access is prohibited.</banner>
</config>
YAML output
config:
  "@env": prod
  app:
    name: billing
    version: "1.10"
    enabled: "yes"
  server:
    - "@host": db-1
      "@port": "5432"
    - "@host": db-2
      "@port": "5432"
  banner: |-
    Welcome to billing.
    Unauthorised access is prohibited.

This output was produced by the converter on this page with Detect numbers switched off (so 1.10 stays “1.10”) — load it with the “Spring beans” preset above and change any option to see the effect.

How XML maps to YAML

In XMLBecomes in YAML
<port>8080</port>port: 8080
Attribute env="prod""@env": prod
Repeated <server>a YAML list - …
<enabled>yes</enabled>enabled: "yes" (quoted, stays a string)
<date>2026-10-21</date>date: "2026-10-21"
Long multi-line text| block scalar
Empty element""

Things that trip people up

XML vs YAML at a glance

PropertyXMLYAML
SpecificationXML 1.0 Fifth Edition (W3C, 2008)YAML 1.2.2 (2021)
File extension.xml.yaml / .yml
Media typeapplication/xml (RFC 7303)application/yaml (RFC 9512)
Data typestext only (types come from a schema)string, int, float, bool, null, map, sequence (+ dates in many parsers)
CommentsYes <!-- -->Yes #
NestingUnlimitedUnlimited (indentation)

Frequently asked questions

5 answers
Why are some values quoted in the YAML?
Values like yes, no, on, 1.0 or 2026-10-21 would be read as booleans, numbers or dates by many YAML parsers. Quoting keeps them as the strings they were in the XML.
How are XML attributes shown in YAML?
As keys with an @ prefix, quoted because @ is reserved in YAML — for example "@id": 7. You can change the prefix to _ or remove it.
Can I convert a Maven pom.xml to YAML?
Yes. Tick Strip namespace prefixes to drop the xmlns noise; dependencies become a YAML list under dependencies.dependency.
Will the YAML convert back to the same XML?
Structurally yes, using YAML to XML on this site, which understands the same @ and #text conventions. Comments and attribute order aren't preserved.
Is my data uploaded anywhere?
No. The XML is parsed and converted by JavaScript in your browser tab; nothing is sent to a server, so it is safe for internal exports, customer lists and configuration files with secrets.