XML to YAML Converter
Convert XML to YAML online: elements become mappings, repeated elements become lists and attributes are kept as prefixed keys. Free, instant and private in your browser.
π Runs entirely in your browser β nothing is uploadedConvert XML documents to YAML
YAML has become the default format for configuration β Kubernetes manifests, GitHub Actions, Docker Compose, Ansible, Spring Boot and countless static-site generators β while many existing settings, exports and integrations are still stored as XML. This XML to YAML converter moves data from one to the other without hand-editing. Each element becomes a YAML key, nested elements become indented mappings, siblings with the same name become a list, and text values are written as plain scalars with quoting only where YAML requires it.
The XML is validated first, so a missing closing tag or a broken attribute produces a clear message with the line and column instead of silently wrong output. The XML declaration and processing instructions are dropped, and whitespace around text is trimmed.
Attributes and value types
YAML has no notion of attributes, so they are written as ordinary keys with a prefix β @ by default β and the text of an element that also has attributes goes under #text. This mirrors the XML to JSON converter, so the same structure can be loaded by any YAML or JSON library. If you only care about element content, untick Keep attributes for a cleaner result. Convert numbers and booleans turns values such as 9.99 and true into native YAML types; switch it off to keep everything as text, which protects IDs, postcodes and version numbers like 1.10 from being reinterpreted.
Tips before using the YAML
Remember that XML cannot express whether an element is a list: one occurrence becomes a mapping, several become a sequence. If the consuming tool always expects a list, use a sample with multiple items or adjust the structure afterwards. Element order is preserved, but comments in the XML are not carried over. Validate the final file with the tool that will read it β kubectl --dry-run, a CI linter or your application's config loader. Everything runs locally, so internal configuration never leaves your device. Need JSON instead? Use the JSON β YAML converter.
How to use
- Paste XMLPaste an XML document or click Load sample.
- Choose optionsSet the attribute prefix and decide whether to keep attributes and convert value types.
- Copy the YAMLCopy the YAML or download it as a .yaml file.
Frequently asked questions
How are attributes shown in YAML?
@ by default, written in quotes because @ cannot start a plain YAML key: '@id': bk101. Untick Keep attributes to leave them out.How are repeated elements converted?
- items. An element that appears once stays a mapping.