XML to CSV Converter
Flatten repeated XML elements into CSV rows with attributes and child text as columns. Great for opening XML data in Excel or Sheets.
How to use the xml to csv converter
Paste XML containing a list of repeated elements. CSV appears live on the right, with each repeated element becoming a row.
Formula & explanation
Find the first repeated element under the root. Each one becomes a CSV row; its child elements and attributes become columns. Single-element trees won't produce useful CSV.
Examples
<rows><row><name>Alice</name></row><row><name>Bob</name></row></rows> becomes a two-row CSV
Frequently asked questions
- Why doesn't my XML produce any rows?
- CSV needs a list of records. We look for a repeated sibling element to flatten. If your XML has nested unique elements, there's nothing to enumerate — restructure to a list, or pick a sub-tree that is one.
- What about attributes?
- Attributes on the row elements become CSV columns alongside child elements. They're prefixed with @_ in the column name so you can tell them apart.
Related developer tools tools
- CSV to XML ConverterConvert CSV rows into XML elements with column headers as tag names. Useful for Excel exports, legacy systems, and ETL pipelines.
- JSON to XML ConverterConvert JSON objects and arrays to well-formed XML. Maps object keys to elements, array items to repeated elements, with optional root wrapper.
- JSON to CSV ConverterConvert JSON arrays to CSV with automatic header detection from object keys. Handles nested values and arbitrary delimiters.
- XML to JSON ConverterConvert XML to JSON for legacy API integration, SOAP responses, and config migration. Handles attributes, namespaces, and text content.
- CSV to JSON ConverterConvert CSV to a JSON array of objects. Uses the first row as keys, handles quoted values, and detects common delimiters automatically.
- XML FormatterFormat, indent, and validate XML documents. Detects malformed tags, unclosed elements, and bad attributes with clear line-level error messages. Great for config and API work.