AnyFormat

00 XML → YAML

XML to YAML

Markup in, readable config out.

01XML in
02YAML out
03Options 7

XML cannot express "a list of one". Always-arrays gives every consumer a consistent shape at the cost of extra brackets.

Attributes are prefixed with @ so they cannot collide with child elements.

Removes the outermost wrapper so the result starts at the useful data.

  • No upload The conversion runs in this tab. Your file never travels — not to us, and not to the advertising.
  • No sign-up, no email, no daily cap There is no account system to sign up to.
  • No size limit we invented Only your device's memory — about ~2 GB on a desktop browser, ~400 MB on a phone.
  • Turn your Wi-Fi off and convert anyway The conversion needs nothing but this page. Ads will not load without a connection; your file will still convert. That is the whole claim, and it takes five seconds to check.

Converts XML into YAML, which is generally far easier to read and edit. Common when migrating an old XML configuration file to a modern tool that expects YAML.

The result is usually much shorter

XML repeats every element name twice — once to open and once to close — and YAML names each key once. A configuration file typically shrinks by a third to a half, and nesting becomes visible as indentation rather than as matching tags.

Attributes and the @ prefix

Attributes keep the @ prefix so they stay distinguishable from child elements. In YAML that reads a little oddly, and for a config file you are rewriting by hand it is often worth turning attributes off and re-adding the few that matter as ordinary keys.

Elements that carry text and attributes at once

XML lets an element hold attributes and text in the same breath — <link href="/a">Home</link> — and YAML has no shape for that. The attribute becomes @href and the text becomes #text, so what was one line is three. Elements with no attributes skip the wrapper and map straight to their value, which is why some parts of the output are much flatter than others. Truly mixed content, text with elements interleaved mid-sentence, is the one XML shape that has no clean YAML form at all.

Questions

Why do keys start with @?
They came from XML attributes. Turn “Keep attributes” off if the document uses them only for metadata.
Can I convert an old XML config to a modern YAML one this way?
As a starting point, yes — the structure comes across exactly. You will normally want to fold the attributes into ordinary keys by hand afterwards, which is a small job on a config file and makes the result far more readable.
A field is sometimes a list and sometimes not.
That is XML’s single-element problem: it cannot say “a list of one”. Set “Repeated elements” to “Always arrays” for a shape that never varies.
Is my data uploaded anywhere?
No. The conversion runs as JavaScript inside this tab. Open your browser's Network panel and convert something — you will see no request carrying your data, because there is no server to send it to. You can also turn your Wi-Fi off and convert anyway.