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 fileTap to 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
- Drop the .xml file above or paste the XML. It is parsed by your browser, so nothing is uploaded.
- Check the row element. The element that repeats most - order, item, record, product - is chosen. Pick another under Rows from if needed.
- Decide on attributes and namespaces and check the preview.
- 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 readprice, notg: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
The converter scans the whole document for the element that repeats most - the records - and makes each one a row, however deeply it is nested. If it picks the wrong one, choose another from the Rows from list; every repeating element is offered with its count.
Each attribute becomes a column prefixed with @, so <product sku="A-100"> gives an @sku column. Untick 'Include attributes' to leave them out.
With a dot path from the row element: <stock><warehouse>east</warehouse></stock> becomes stock.warehouse. Repeated child elements are numbered - phone[1], phone[2] - so each value keeps its own column.
Prefixes are stripped by default so g:category becomes a plain category column. Untick 'Strip namespace prefixes' to keep them, which matters only when two namespaces use the same element name.
No. The XML is parsed by your browser's own XML parser and the CSV is written locally. Nothing is sent to a server.