ExcelTool.io

XML to CSV Converter

Convert an XML file to CSV: the repeating records are found wherever they are nested, and child elements and attributes become columns. Free, no sign-in, and nothing is uploaded.

Drop your file here or choose a file

Opened on your device - never uploaded · up to 50MB

Supports .xml, .txt · or paste a file from your clipboard

No file handy? · download it

How to Convert XML to CSV

  1. Drop the .xml file above or paste the XML. It is parsed by your browser, so nothing is uploaded.
  2. Check the row element. The element that repeats most - order, item, record, product - is chosen. Pick another under Rows from if needed.
  3. Decide on attributes and namespaces and check the preview.
  4. Download the CSV.

How XML Becomes Rows and Columns

A CSV needs one record per line, so the first job is finding the records. The converter walks the whole tree and lists every element that repeats, with the number of times it appears; the most frequent one becomes the row. This handles the usual shapes - a feed of <item> elements, an export of <Invoice> records three levels down, a list of <row> elements - without you having to write an XPath.

Inside each record, every value becomes a column named by its path: <price> is price, <stock warehouse="east"> adds stock.@warehouse, and a second <phone> becomes phone[2]. A record that lacks a field leaves that cell blank rather than shifting the other columns.

Common XML Files People Convert

  • Product feeds (Google Merchant, affiliate networks) - the g: namespace prefix is stripped so columns read price, not g:price.
  • Sitemaps - each <url> becomes a row with loc, lastmod and priority.
  • Exports from accounting, ERP and e-commerce systems - orders, invoices and customers as nested records.
  • RSS and Atom feeds - one row per item or entry.

XML to CSV or XML to Excel?

Choose CSV when the data is going into another program - a database, a mail-merge, an import screen. To read and format it, the XML to Excel converter writes an .xlsx with the same row detection. For JSON files, use JSON to CSV.

Frequently Asked Questions

Related Tools