XML → YAML

About the XML → YAML playground

XML → YAML converts hierarchical XML markup into clean, indentation-based YAML. Elements become mapping keys, nested elements become nested mappings, repeated sibling elements become sequences, and attributes are preserved (commonly under a dedicated key). The result is far easier to read and edit than the original tag soup, which is handy when migrating legacy XML config to YAML-based tooling.

XML (eXtensible Markup Language) is a verbose, tag-based markup language used for documents and data interchange. YAML (YAML Ain't Markup Language) is a concise, human-readable serialization format that relies on indentation instead of closing tags. This converter walks the XML tree and re-expresses each node as YAML mappings and sequences, trimming the syntactic noise while keeping the data hierarchy intact.

HostedXML → YAML runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

External resources

  • w3.org/XML— Official website

Input (XML)

<server>
  <host>localhost</host>
  <port>8080</port>
</server>

Output (YAML)

server:
  host: localhost
  port: 8080

Input (XML with repeats)

<roles>
  <role>admin</role>
  <role>user</role>
</roles>

Output (YAML)

roles:
  role:
    - admin
    - user

Input (XML with attributes)

<user id="1" active="true">
  <name>Ada</name>
</user>

Output (YAML)

user:
  "@id": "1"
  "@active": "true"
  name: Ada

Input (XML nested tree)

<config>
  <database>
    <host>db.local</host>
    <port>5432</port>
  </database>
</config>

Output (YAML)

config:
  database:
    host: db.local
    port: 5432

Input (XML mixed children)

<book lang="en">
  <title>XML Guide</title>
  <price>29.99</price>
</book>

Output (YAML)

book:
  "@lang": en
  title: XML Guide
  price: "29.99"

Input (XML empty element)

<status>
  <online/>
  <message>OK</message>
</status>

Output (YAML)

status:
  online: null
  message: OK

Input (XML list of records)

<users>
  <user>
    <id>1</id>
    <name>Ada</name>
  </user>
  <user>
    <id>2</id>
    <name>Linus</name>
  </user>
</users>

Output (YAML)

users:
  user:
    - id: "1"
      name: Ada
    - id: "2"
      name: Linus

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

Workflow

Paste XML markup; the converter walks the element tree.

Elements become mapping keys; nested elements become nested mappings.

Repeated sibling elements collapse into a YAML sequence.

Attributes and text

Attributes are preserved, commonly grouped under a dedicated key.

Element text content maps to scalar values.

Closing tags vanish, replaced by indentation.

Privacy

The XML is parsed in-browser; your markup never leaves the page.

No server round-trip for legacy config migration.

Tips

Great for trimming verbose XML config down to readable YAML.

Check how repeated tags fold into lists before adopting the output.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It parses XML and outputs equivalent YAML, turning elements into mapping keys and repeated elements into sequences.
No. The conversion is performed in your browser; the XML never leaves your device.
Yes, free with no registration or limits.
Attributes are typically placed under a special key (such as a leading @ or attributes map) so they remain distinct from child elements in the YAML.
When the same element name appears multiple times under one parent, those values are grouped into a YAML sequence to preserve all of them.
xml
yaml

Output

YAML output

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup