XML to CSV Converter
Turn an XML export, feed or report into a table. The tool finds the repeating records and gives each one its own row.
or drop a file here · .xml, .txt · up to 20 MB
About the XML to CSV Converter
XML is good at nesting but awkward to filter, sort or total. This converter finds the records in an XML document and lays them out as rows and columns for Excel, Google Sheets or LibreOffice.
How rows and columns are chosen
The tool looks through the whole document for the element that repeats most often under one parent. In a catalogue that is usually the book or product element; in a bank statement it is the transaction. Each occurrence becomes one row, and the page tells you which element it picked and the path to it, such as catalog › book.
Inside each record:
- Attributes and child elements become columns. Attribute columns lose their @ so the header reads cleanly.
- Nested elements become columns joined with a dot, for example price.currency.
- When an element has both attributes and text, the text column ends in .value.
- A list inside a record, such as several tag elements, is written into one cell as JSON text.
Worked example
Select Try an example, keep the comma delimiter, and choose Convert to CSV. You get a header row and two data rows, one per book, with columns for id, lang, title, the price currency and value, and the tags. The second book has no tags, so its last cell is blank.
Opening the file in a spreadsheet
Leave Protect against spreadsheet formulas ticked if anyone will open the file in a spreadsheet. A cell that starts with =, +, - or @ could otherwise be run as a formula. Protected cells get a leading apostrophe.
If your spreadsheet expects semicolons, as many European locale settings do, choose the semicolon delimiter instead.
Related tools
- To keep the nesting, convert to JSON with XML to JSON.
- To go back from a table to XML, use CSV to XML.
- For JSON data, use JSON to CSV.
How to use XML to CSV Converter
- Paste XML or open an .xml file.
- Choose the delimiter. Keep formula protection on if the file will be opened in a spreadsheet.
- Select Convert to CSV, check which element became the rows, then copy or download the CSV.
Privacy: how it works
Everything happens in your browser. Your text is not sent to any server.
Frequently asked questions
How does it decide what a row is?
It looks for the element that repeats most often, such as <book> inside <books>, and makes each one a row. The page tells you which element it used.
How are nested elements shown?
Nested fields become columns joined with a dot, such as price.currency. Attribute names lose their @ in the header. Lists inside a record are written as JSON text in one cell.
What is formula protection?
Cells starting with =, +, - or @ can run as formulas in spreadsheet programs. With protection on, such cells get an apostrophe in front so they are shown as text.