Data and JSON tools Free · No sign-up · No upload

Convert YAML to XML

Turn a YAML file into indented, well-formed XML. Keys that start with @ become attributes, and lists become repeated elements. It runs in your browser, so configs stay private.

  • Free, every time
  • No cloud processing
  • Attributes with @ keys
  • Valid element names
Your data
Used when the data has no single top element
  • Runs on your device. Files are never uploaded.
  • Free and unlimited. No sign-up, no watermark.
Private: processed in your browserNo upload waitIN: YAML → OUT: XML
How was YAML to XML?
How it works

YAML to XML in three steps

No account, no email, no waiting for an upload.

  1. STEP 01

    Add your YAML

    Use a .yaml, .yml or .txt file, or paste into the box.

  2. STEP 02

    Set the XML options

    Choose the attribute prefix, the root element, the name for list items and the indent.

  3. STEP 03

    Copy or download the XML

    The file starts with an XML declaration and is indented.

What you get

What YAML to XML does, and what it doesn't

We'd rather tell you up front than surprise you after the download.

What you get

  • Root you controlIf your YAML has one top-level key it becomes the root. Otherwise the data is wrapped in a root element with the name you choose.
  • Attributes from @ keysA key such as @id is written as an attribute. Pick another prefix if @ clashes with your data.
  • Lists as repeated elementsEach list item becomes an element. Lists inside lists use the item name you set.
  • Safe namesKeys with spaces or characters that XML does not allow are changed, and the note says how many.
  • Several documentsA file with --- separators becomes a list of documents in the XML.

Good to know

  • Anchors are expandedAliases are written out in full, since XML has no equivalent.
  • Comments are droppedXML output holds data only. Add comments by hand afterwards.
  • Null valuesA null becomes an empty element, which looks the same as an empty string.
Private by design

Your data never leave your device

The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.

Typical online tool upload

Your device→Their server→Your device

Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.

Mediaextractr no upload

Your device does all the work

The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.

Made for real work

When people use YAML to XML

Feed an XML-only service

Write test data in YAML, then convert.

Migrate configuration

Move settings from YAML to an XML-based tool.

Draft XML more comfortably

YAML is quicker to type; convert when ready.

Prepare partner feeds

Maintain data in YAML and export XML.

Compare

Mediaextractr vs typical upload tools

MediaextractrPrivateTypical upload tools
Your file is uploadedNeverYes
Sign-up neededNoOften, after a few files
Daily file limitNoneOften 1–2 free files
WatermarkNeverSometimes
Wait for upload & downloadNoYes
Speed on very large filesDepends on your deviceDepends on their servers

How YAML maps to XML

A YAML map becomes an element with a child for every key. A scalar becomes text inside its element. A list becomes the same element repeated, once per item. So a key called book holding three items gives three book elements.

Attributes are the one thing YAML has no direct form for. That is why the @ prefix convention exists: @id: 7 becomes id="7" on the parent.

Check the result

After converting:

A small example: YAML to XML

A YAML map with a key called server, holding host and port values, becomes a server element with host and port children. Add a key named @env with the value prod, and it becomes env="prod" on the server element. Lists of servers turn into repeated server elements.

FAQ

Questions, answered

How do I convert YAML to XML?

Paste the YAML, set the root and item names, and copy the XML.

How do I write an XML attribute from YAML?

Start the key with @, for example @id.

Is my YAML config uploaded for conversion?

No. It is parsed and written out as XML by script in this tab, so settings with secrets stay on your device.

What happens to YAML lists?

Each item becomes an element with the same name.

What if my keys are not valid XML names?

They are changed to valid names, for example by replacing spaces with underscores.

Does this work on mobile browsers?

Yes. Paste the YAML in a current phone or tablet browser and copy the XML.