XML to Excel: Turn XML Records into Rows and Columns
In this article
XML files turn up everywhere — product feeds, bank and accounting exports, e-invoice data, sitemaps — but they are hard to read and impossible to filter or total without a spreadsheet. The free XML to Excel converter finds the repeating records in an XML file and turns each one into a row, with every field as a column. This guide shows how it works with a real example and how to deal with tricky files.
How to convert XML to Excel
- Open the XML to Excel converter and choose your .xml file (up to 5 MB).
- Choose the output: Excel (.xlsx) or CSV.
- Convert and download.
An example
Take this order export:
<orders>
<order id="1001" status="paid">
<customer>Priya Sharma</customer>
<address><city>Delhi</city><pin>110001</pin></address>
<total>1250.00</total>
</order>
<order id="1002" status="pending">
<customer>Ravi Kumar</customer>
<address><city>Pune</city><pin>411001</pin></address>
<total>480.00</total>
</order>
</orders>
The converter produces this table:
| @id | @status | customer | address.city | address.pin | total |
|---|---|---|---|---|---|
| 1001 | paid | Priya Sharma | Delhi | 110001 | 1250.00 |
| 1002 | pending | Ravi Kumar | Pune | 411001 | 480.00 |
How the flattening works
- Records — the converter looks for the first element that contains two or more children, and treats each child as a row. Wrapper elements around the list are skipped automatically.
- Attributes become columns prefixed with
@, such as@id. - Nested elements become dotted column names, such as
address.city. - Repeated child elements are numbered: a second
<phone>becomesphone[2]. - Missing fields leave the cell empty, so records don’t need identical structures.
Excel or CSV?
Choose Excel (.xlsx) to open the result directly in Excel, Google Sheets or LibreOffice with Hindi and other text displayed correctly. Choose CSV to import the data into another system. CSV files are saved as UTF-8 with a byte-order mark, so Excel recognises the encoding when you double-click them.
Troubleshooting
“This is not valid XML”
Every opening tag needs a closing tag, and characters like & must be written as &. Open the file in a browser or the XML formatter to find the exact line with the error.
The file was rejected because of a DOCTYPE
For security, files containing a <!DOCTYPE> declaration are rejected — DOCTYPEs can be used in attacks that make a parser read other files. If you trust the file, delete the DOCTYPE line and convert again; most data doesn’t need it.
“No repeating records were found”
The file has only one record, or the records are nested in an unusual way. Check the structure with the XML formatter.
Lots of mostly empty columns
Very irregular XML, where every record has different fields, produces wide, sparse sheets. Filter or hide the columns you don’t need in Excel.
Privacy and limits
This converter runs on our server. Your file is uploaded over HTTPS and deleted automatically within an hour. Server tools include a free daily allowance; after that each conversion uses 1 credit.
Related tools: XML formatter to read or validate XML, and JSON to Excel for JSON data.