press ⌘K to switch tools
FORMAT & CONVERT
XML to YAML Converter
Convert XML documents to YAML format.
xml-yaml
§01 ABOUT THIS TOOL
Overview
Migrating legacy XML configuration to YAML-based tooling (CI pipelines, Kubernetes
manifests, application config) usually means tedious hand-editing. This converter
parses XML with the browser’s native DOMParser and emits YAML via js-yaml with
2-space indentation and no line wrapping. Attributes survive as @-prefixed keys
and repeated tags become sequences.
How to use
- Paste your document into the XML field. Conversion runs as you type.
- Read the result from the YAML field. Malformed XML shows an
Invalid XMLerror between the fields instead.
Examples
<config><host>localhost</host><port>8080</port></config>→
config:
host: localhost
port: '8080'
<server id='a'><mode>fast</mode></server>→ theidattribute appears as'@id': aalongsidemode: fast.
Notes
All values arrive as strings, because XML has no type system: 8080 becomes the
quoted scalar '8080', not a number — review numeric and boolean fields after
conversion. Elements without attributes or children collapse to plain strings,
and empty elements become empty strings.
FAQ
Is my XML sent to a server?
No. The document is parsed with your browser's built-in DOMParser and serialized to YAML by the js-yaml library, all locally. Nothing is uploaded.
How are attributes and repeated elements handled?
Attributes become keys prefixed with @, text inside an attributed element goes under #text, and repeated sibling tags are collected into a YAML sequence (list).
Can I convert YAML back to XML with this tool?
No, the conversion is one-way from XML to YAML. The mapping is also lossy — comments, CDATA distinctions, and processing instructions are not carried over.