Skip to content
Data & Developer Guides

XML to Excel: Turn XML Records into Rows and Columns

FreeToolConvert Editorial Team Published 3 min read
In this article
  1. How to convert XML to Excel
  2. An example
  3. How the flattening works
  4. Excel or CSV?
  5. Troubleshooting
  6. Privacy and limits

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

  1. Open the XML to Excel converter and choose your .xml file (up to 5 MB).
  2. Choose the output: Excel (.xlsx) or CSV.
  3. 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@statuscustomeraddress.cityaddress.pintotal
1001paidPriya SharmaDelhi1100011250.00
1002pendingRavi KumarPune411001480.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> becomes phone[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 &amp;. 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.

More guides