XML to Excel Converter
CV-129Paste XML that holds a list of records, such as orders or products, and download an .xlsx workbook with one row per record and one column per child element or attribute. The first rows show on the right before you download.
Runs in your browser. Nothing is uploaded.
XML
Excel file
Paste XML to build the workbook.
How to use it
- Paste your XML on the left, or press Open file to load an .xml file. Press Sample to see an example.
- Check the preview: one row per record, with column names from the element paths.
- If the wrong element was picked as the record, add a first line such as -- row: product.
- Press Download .xlsx and open the file in Excel, Google Sheets, Numbers or LibreOffice.
How the records are found
The converter looks for the first element, from the root down, whose children repeat a name, and treats those repeated children as the records. In <orders><order>...</order><order>...</order></orders>, each order is a row. If your file has a different shape, put a line such as -- row: item at the very top, and every item element in the document becomes a row; an item inside another item stays part of the outer one.
How fields become columns
Each child element becomes a column named by its path, so <address><city> becomes address.city. Attributes become columns that start with @, such as @id, and an element with both attributes and text gets a column for each. A child that repeats inside one record, such as two item elements, gets numbered columns items.item[1] and items.item[2], so no value is lost. Columns appear in the order they are first seen.
Numbers, IDs and leading zeros
XML has no number type, so every value starts as text. With Store numbers as numbers on, a plain number of up to 15 significant digits becomes a number cell, so you can sum it. A ZIP code such as 02139, an ID with leading zeros or a 20-digit account number stays text, so no digit is lost. Text that starts with = is stored as text and never runs as a formula. Untick the option to keep everything as text.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
There is no XML to convert. | The input holds a -- row: line but nothing after it. | Paste the XML below the -- row: line, or press Sample to see the expected input. |
Questions people ask
How do I convert an XML file to Excel?
Paste the XML here or open the .xml file, check the preview of the first rows and press Download .xlsx. The workbook opens directly in Excel, with the header row in bold and one row per repeated record in your XML.
Why did it pick the wrong element as the row?
It picks the first element, from the top, that has repeated children. If your data sits deeper, or the first repeat is something else such as a list of categories, add -- row: followed by the element name on the first line to choose the record element yourself.
What happens to nested elements?
They are flattened into columns named by their path, such as customer.address.city. Repeated nested elements get numbered columns. Deeply nested data with many repeats can make many columns; if that happens, pick a deeper record element with the -- row: line.
Will Excel drop the leading zeros from my IDs?
No. Values with leading zeros, values longer than 15 digits and anything that is not a plain number are written as text cells, so Excel shows them exactly as they appear in the XML. Only plain numbers become number cells, and you can turn that off.
Is my XML uploaded to make the workbook?
No. The XML is parsed and the .xlsx file is built by your browser on this device. Nothing is sent to a server, and the download is made locally.
Does it keep namespaces and comments?
Namespace prefixes stay in the column names exactly as written, such as ns:title. Comments and processing instructions are dropped, and CDATA sections are read as plain text. Named entities other than the five built into XML, such as , stop with an error that gives the line and column.
About this tool
Finds the repeated element (the most common child name under the first element that repeats one) and makes one row per record; put "-- row: name" on the first line to choose it yourself. Child elements become columns named by their path, such as address.city, attributes become @name columns, and repeated children get numbered columns such as items.item[1]. Text is trimmed. Values such as 02139 or a 20-digit ID stay text; only plain numbers of up to 15 digits become numbers, and that can be turned off. Text starting with = stays text. Namespace prefixes are kept as written, comments are dropped, and named entities other than the five built into XML stop with an error.