XML to YAML Converter
Parses XML and prints the value as YAML on this page.
About this tool
This page converts the whole document. CSV tools flatten one selected row collection instead.
Mixed content and namespaces may be simplified. This is a structural conversion, not a schema mapping.
How to use it
- Open this page and provide the input it asks for.
- Set the options that are visible, then use Convert.
- Read the result in the panel. Copy it or download it when a file is offered. The input stays in this browser.
Limitations
- Mixed content and namespaces may be simplified. This is a structural conversion, not a schema mapping.
The JSON-shaped parse, printed as YAML
Attributes, numbers, and the one-versus-many switch come from the XML parse
The same attribute-aware parser used for XML-to-JSON reads the document, and the result is dumped as YAML. Attributes appear as keys starting with @_. Text shared with children or attributes appears as #text. A comment is absent. A declaration can appear as a ?xml key. Digit-like element text can already be a number before YAML is printed, so a postal code can lose leading zeros. Attribute text stays a string. Trimmed mixed content can drop spaces that sat beside an inline tag. CDATA becomes a plain scalar.
A tag seen once is a mapping. The same tag seen twice is a sequence. The YAML therefore changes shape when a second sibling is added, just as the JSON would. Indentation in the XML source is not kept. The YAML indent is the dumper’s. There is no delimiter in the source to preserve. The table conversion of XML uses a different parser, with a single @ prefix and no numeric conversion, so a CSV made from the same file will not line up with this YAML key for key.
Dump defaults
The dump uses the library default line width, so a long text node can be folded. That fold is a spelling choice. It is not an extra element. Anchors are not created just because the XML used a repeated phrase. Each occurrence is its own scalar unless the parser produced shared structure, which ordinary XML does not.
Nulls and empty elements
XML does not carry JSON null. An empty element dumps as whatever the parser produced, often an empty mapping or an empty string, not the word null. You should not describe the YAML as a faithful typed copy. Use it to read a tree in YAML syntax, including the awkward @_ keys. If you need a rectangle, use the XML-to-CSV page and accept dotted columns instead of a tree.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

