XML Converter — Convert XML to JSON, YAML or CSV Online
Convert XML to JSON or YAML instantly. Free, browser-based, no signup.
Converting XML to Other Formats
XML is a structured markup language used widely in SOAP APIs, Android resources, Maven/Gradle configs, RSS feeds, and legacy enterprise systems. Converting XML to JSON makes it easier to work with in modern JavaScript/Python applications. Converting XML to YAML is useful for creating Kubernetes or Ansible configs from XML data sources. This tool uses the browser's built-in DOM parser for XML and js-yaml for YAML output. For a full JSON toolkit, visit JSON Indent; for YAML formatting and validation, visit YAML Indent.
How attributes are handled
XML attributes are prefixed with @ in the output
(e.g. <book id="1"> becomes {"@id": "1"}).
Repeated child elements with the same tag name are automatically grouped into arrays.
Converting XML to CSV
XML to CSV works best on a list of repeated elements — for example a
<library> of
<book> elements. Each repeated element becomes a row and each
child element or attribute a column, so you can open the result directly in Excel or Google Sheets. Nested
elements are flattened into dot-notation columns (e.g. author.name),
attributes appear as @-prefixed columns, and values containing commas or quotes are escaped per RFC 4180.
Frequently Asked Questions
Is the conversion lossless?
Not fully. XML has features (namespaces, processing instructions, mixed content) that don't map cleanly to JSON or YAML. For typical data-oriented XML, the conversion preserves all elements, attributes, and text content.
How do I convert XML to CSV?
Choose "XML → CSV" and paste XML containing a list of repeated elements (e.g. a list of <book> elements). Each repeated element becomes a row and each child element or attribute a column. Click Download to save a .csv file for Excel or Google Sheets.
Is my data safe?
Yes. All conversion happens in your browser. No data is sent to any server.