Input
Ready
Lines: 0
Words: 0
Chars: 0
Size: 0 KB
Input statistics are available via the Stats button above this field.
Output
Lines: 0
Words: 0
Chars: 0
Size: 0 KB
Output statistics are available via the Stats button above this field.
Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.
What the XML to CSV Converter does
The XML to CSV Converter flattens repeated XML records into spreadsheet rows. It finds the repeating element (for example every <order> inside <orders>), turns each one into a row, and turns child elements into columns.
Attributes are kept as columns too. They are prefixed with @_ so you can tell them apart from child elements: an id="1001" attribute becomes the column @_id. Deeper nesting is flattened into joined column names, so no value is silently dropped.
When to use it
- Pulling records out of an XML export, sitemap, RSS feed or SOAP response so you can sort and filter them in Excel or Google Sheets.
- Comparing two XML exports: convert both to CSV and compare them line by line with the Text Diff Checker.
- Loading XML data into a database or BI tool that only imports CSV.
- Auditing a large XML configuration by sorting and counting its entries in a spreadsheet instead of scrolling through nested tags.
Worked example
Input
<orders>
<order id="1001"><customer>Ana</customer><total>42.50</total></order>
<order id="1002"><customer>Ben</customer><total>18.00</total></order>
</orders>
Output
customer,total,@_id
Ana,42.50,1001
Ben,18.00,1002Common questions about the XML to CSV Converter
Why does a column start with @_?
That column came from an XML attribute rather than a child element. The prefix keeps an attribute and an element with the same name from overwriting each other. Rename the header in your spreadsheet if you prefer.
What happens to deeply nested elements?
Nested elements become columns whose names join the path with an underscore, such as address_city. If one record has several children with the same name, they are kept as a list in a single cell.
My CSV has only one row. Why?
The XML probably has a single record, or the records are not siblings under one parent. Make sure the repeating elements sit side by side, like several <order> elements directly inside <orders>.