sitekits.dev
press ⌘K to switch tools
FORMAT & CONVERT

XML to YAML Converter

Convert XML documents to YAML format.

local
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

  1. Paste your document into the XML field. Conversion runs as you type.
  2. Read the result from the YAML field. Malformed XML shows an Invalid XML error 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> → the id attribute appears as '@id': a alongside mode: 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.