100% local — your data never leaves your browser

XML to YAML — Readable in One Step

Convert XML to YAML. The tree becomes indentation instead of tags, which is usually the reason you wanted it out of XML to begin with.

Instant Private Zero cookies
Indentation

XML input

YAML output

What this tool does

The document becomes a YAML mapping, with the same shape XML-to-JSON produces — attributes as @_-prefixed keys, text under #text when an element carries both, a sequence when an element repeats.

<user id="1"><name>Ada</name></user>
user:
  name: Ada
  "@_id": "1"

Why those keys are quoted

Two of the characters this mapping produces are reserved in YAML.

@ cannot begin a plain scalar — the specification reserves it — so @_id has to be quoted. # opens a comment, so #text written bare would make the rest of the line vanish. Quoting them is not decoration; it is the only way to write them.

Why some values are quoted too

YAML has two versions in wide use, and they disagree about what a bare word means.

written plainlyYAML 1.2 readsYAML 1.1 reads
NOthe string NOfalse
yesthe string yestrue
12:30the string 12:30750 (sexagesimal)
2026-01-01the stringa timestamp

YAML 1.2 is what most JavaScript libraries write. YAML 1.1 is what PyYAML implements, and PyYAML is what a very large share of the world actually reads YAML with.

So a country code NO, written plainly, becomes False in Python. That is the “Norway problem”, and nothing in the file signals it — the document is valid either way, it simply stops meaning the same thing.

This tool quotes exactly those ambiguous scalars and nothing else. A real boolean stays true, a real null stays null, an ordinary word stays bare. The output is valid YAML 1.2, and both readers find the same values in it.

Multi-line text

Text containing line breaks becomes a block scalar:

a: |-
  first line
  second line

That is YAML’s readable form for exactly this, and it round-trips without escapes.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

Why are some keys quoted and others not?
Because YAML reserves two characters this conversion produces. `@` cannot start a plain scalar — the specification keeps it for future use — so an attribute key `@_id` must be quoted. `#` starts a comment, so `#text` must be quoted too. Everything else is written plainly.
Why is my NO in quotes? I wanted it plain.
Because unquoted it would stop being the string `NO` for a large share of readers. YAML 1.1, which PyYAML implements, reads bare `NO` as the boolean false — the well-known “Norway problem”. The quotes cost two characters and keep the country code a country code.
How do I get a list when there is only one element?
You cannot, from the document alone: one `<item>` and a list of one `<item>` are written identically in XML, and only a schema tells them apart. One element gives a mapping, two or more give a sequence. Normalise on the consuming side if it needs a list either way.

Related converters