Skip to content
MyDailyTool

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