Convert XML to YAML Online
Convert XML configuration to modern YAML, free, in your browser.
# // Invalid XML: DOMParser is not defined
Use cases
Legacy XML to modern YAML
Spring/Java migration
Convert Spring Framework XML beans to structured YAML as a starting point for modernizing your project.
CI/CD pipelines
Transform Maven/Ant XML configurations to YAML for GitHub Actions, GitLab CI, or CircleCI.
100% private
Your XML never leaves your browser. No servers, no sign-up, no limits.
Real-time
Conversion happens as you type. XML syntax errors are flagged instantly.
How it works
Three steps, no hassle
Paste your XML
Paste the XML content into the left editor. Supports full XML 1.0: attributes, namespaces, CDATA, and entities.
Automatic conversion
The converter parses the XML structure and generates clean, indented YAML 1.2. The entire process runs in your browser — nothing is uploaded.
Copy or download the YAML
Get the resulting YAML ready to use in Docker Compose, GitHub Actions, Kubernetes, Ansible, or any modern toolchain.
FAQ
Got questions?
The most common scenario is migrating Java framework configurations that use XML — Spring Framework's applicationContext.xml, Maven build descriptors, Ant build files — to modern YAML-based tooling used by Spring Boot, GitHub Actions, GitLab CI, CircleCI, Kubernetes, and Ansible. XML was the dominant configuration standard between 1998 and roughly 2012; YAML 1.2 (published 2009) has become the preferred human-readable configuration format in the DevOps ecosystem. Converting typical Spring XML configs to YAML reduces file volume by 30–50% while dramatically improving readability.
XML attributes have no direct YAML equivalent. The widely adopted convention is to map them as child keys prefixed with '@' (for example, <bean id='myBean' class='com.example.MyClass'> becomes a YAML object with '@id' and '@class' keys). Text content of an element (#text) is also mapped as a separate key when the element has both attributes and text. This representation is compatible with js-yaml, PyYAML, and SnakeYAML.
Yes. Android resource files and layout files (res/layout/*.xml, res/values/*.xml) are standard XML. The converter produces equivalent structural YAML, useful as an intermediate step when migrating to Kotlin DSL or Jetpack Compose, or for automated resource processing with Python or Ruby scripts. Android namespaces (xmlns:android='http://schemas.android.com/apk/res/android') are preserved as keys in the resulting YAML.
XML 1.0 was published by the W3C in February 1998 as a simplified subset of SGML, designed primarily for data interchange between heterogeneous systems. YAML 1.2 was published in October 2009 as a revision that made YAML a strict superset of JSON. XML requires explicit opening and closing tags, uses attributes and child elements as two parallel mechanisms for data representation, and has native support for namespaces, DTDs, and XML Schema. YAML uses indentation for hierarchy, distinguishes scalars, lists, and maps with minimal syntax, and has no native schema system. For application configuration, YAML is significantly more readable and concise.
This is one of the most common migrations in enterprise Java projects. Spring Framework used XML for bean definitions (applicationContext.xml, beans.xml) until Spring Boot popularized application.yml starting with its first stable release in April 2014. A direct one-to-one conversion of Spring beans XML to YAML is not straightforward because they are semantically different: Spring XML describes the IoC container's object graph, while application.yml holds application configuration properties. However, converting XML to YAML is a useful starting point for understanding the structure before refactoring to Java annotations and property-based configuration.
The generated YAML is syntactically valid per the YAML 1.2 specification and can be parsed by any standard YAML library. However, semantic validity for Kubernetes (kubectl apply) or Ansible (ansible-playbook) depends on whether the input XML represents data with the correct structure for those systems. This tool performs structural conversion; if your XML already correctly models a Kubernetes specification or an Ansible playbook, the resulting YAML will be a solid starting point, though manual adjustments for platform-specific types will likely be needed.
Convert XML to YAML: migrating legacy configuration to modern DevOps
XML (eXtensible Markup Language) was published by the W3C in its version 1.0 in February 1998. During the first decade of the 2000s, XML became the universal configuration format in the enterprise Java ecosystem: Spring Framework used XML to define application context and bean graphs (applicationContext.xml, web.xml, beans.xml), Maven adopted XML for its project descriptor (pom.xml, which remains XML to this day), and Ant described build tasks in build.xml. Outside of Java, Android used XML for UI layouts (res/layout/) and resources (res/values/strings.xml, colors.xml), SOAP web services used XML as their messaging protocol, and standards like XHTML, SVG, MathML, and RSS were all built on XML 1.0. The verbosity of XML — mandatory opening and closing tags, the parallel mechanisms of attributes and child elements — was acceptable when machines were the primary readers of configuration files.
YAML 1.2, published in October 2009, shifted the paradigm for human-readable configuration. Unlike XML, YAML uses indentation to express hierarchy, distinguishes maps (objects), lists, and scalars with minimal syntax, and has been a strict superset of JSON since version 1.2. The DevOps ecosystem adopted YAML massively: Docker Compose has used docker-compose.yml since its first public release in December 2013, Kubernetes uses YAML for all manifests since its June 2014 launch, Ansible adopted YAML for playbooks and roles, GitHub Actions uses YAML for workflows (.github/workflows/*.yml), and Spring Boot adopted application.yml as an alternative to application.properties since its first stable release in April 2014. For typical infrastructure configurations, a YAML equivalent of its XML counterpart uses 30–50% fewer characters with significantly better readability.
The need to convert XML to YAML arises frequently in modernization projects. The most common scenario in the Java ecosystem is migrating classic Spring Framework applications (Spring 2.x, 3.x, 4.x with XML configuration) to Spring Boot, where configuration properties are expressed in application.yml. Although the mapping is not one-to-one — Spring XML beans describe the IoC container's object graph, while application.yml holds configuration properties — having the XML converted to structural YAML greatly facilitates analysis and refactoring. Another frequent scenario is migrating Ant or Maven build pipelines (which use XML) to modern YAML-based CI/CD tools. Finally, Android projects that process XML resources with scripts can benefit from the YAML representation for programmatic manipulation. Convertir.ai performs the conversion entirely in your browser using standard JavaScript, without sending any data to a server.