XML to YAML Converter
Paste XML and get the same data as YAML: no closing tags, no angle brackets. Handy when a project moves its configuration from XML files to YAML.
Runs entirely in your browser — nothing you enter here is sent to a server.
Paste XML and get the same data as YAML: no closing tags, no angle brackets. Handy when a project moves its configuration from XML files to YAML.
Runs entirely in your browser — nothing you enter here is sent to a server.
XML was the default configuration format for a generation of software, and it is verbose by design: every value is wrapped in an opening and a closing tag. YAML carries the same tree with indentation alone. A forty-line XML file commonly becomes fifteen lines of YAML, and the part a person needs to read — the values — is no longer buried in markup.
The conversion is mechanical. Each element becomes a key, nesting becomes indentation and repeated elements become a list. What needs a decision is the part of XML that YAML has no direct counterpart for.
Written as keys with a prefix — @enabled: true — next to the element's children. After converting, most people rename them to plain keys.
Several <logger> elements become one logger: key holding a list.
With type detection on, 8443 and true become a number and a boolean. Turn it off to keep every value exactly as written.
XML comments are not carried over. Copy the important ones across by hand — YAML comments start with #.
Treat the result as a faithful translation, not a finished file. A tool that reads YAML configuration usually expects its own key names and structure, which rarely match the XML one to one — Spring's application.yml, for example, is not a transliteration of an XML bean file. Convert to see the data clearly, then reshape it to the schema the target tool documents.
The data is preserved: elements, attributes, text and order. Comments, processing instructions and the distinction between an attribute and a child element (other than the prefix) are not part of YAML.
As keys prefixed with @, placed alongside the element's child keys. You can choose a different prefix, or rename the keys afterwards.
Because YAML would otherwise read it as something else — a number, a boolean, or syntax. Quoting keeps the value identical to the XML original.
Yes: convert YAML to JSON, then JSON to XML. The @ prefix on keys turns them back into attributes.
Upzilla checks your sites, servers and APIs around the clock and alerts you the moment something breaks. 10 monitors free, no card required.