How XML becomes a table
XML has no rows and columns, so the converter looks for the element that repeats, like <book> in <catalog><book>…</book><book>…</book></catalog>, and makes each one a row. If it picks the wrong one, choose another under "Rows": every
repeating element in the file is listed with how many rows it gives.
- Attributes and child elements become columns:
<book id="bk101"><title>…gives columnsidandtitle. - Nested elements get dotted names:
<price currency="USD">44.95</price>givesprice(44.95) andprice.currency(USD). - An element that repeats inside a row (two
<author>s) becomes a column per item (author.0,author.1), one cell with all of them, or a row per item: choose under "Repeated elements". - Values are kept exactly:
&and other entities are decoded, CDATA is kept as text, and ISBNs or codes with leading zeros stay as they are in the Excel file.
How to open XML in Excel
In Excel for Windows (Microsoft 365, 2016 and later): Data → Get Data → From File → From XML, choose the file, select the table in the Navigator (or click Transform Data and expand the nested columns one level at a time), then Load. Older versions have Developer → Import, which needs an XML map and often fails on files without a schema. Where Excel can't import the file, convert it here first.
In Google Sheets
Google Sheets' IMPORTXML function reads web pages by URL with an XPath query; it
can't open an XML file from your computer. Convert the file here, then File → Import the Excel
file.
Questions
- Which element becomes a row?
- The outermost element that repeats and has fields of its own, such as <item> in an RSS feed or <product> in a product feed. You can pick any other repeating element under "Rows".
- What happens to namespaces?
- Prefixes are kept in the column names (g:id, g:price in a Google Merchant feed), so columns from different namespaces stay apart.
- My XML file is rejected as invalid. Why?
- The message says where the problem is (line and column): usually an unclosed tag, an unescaped & in text (it must be &), or two root elements. Fix it in a text editor and try again.
- Is the file uploaded?
- No. The XML is read and converted by your browser; nothing is sent anywhere.
Related tools
- XML to CSV Converter Convert XML to CSV online: pick the repeating element, and attributes and child elements become columns. Free, private: the file never leaves your computer.
- JSON to Excel Converter (XLSX) Convert JSON to an Excel XLSX file online. Nested objects become columns, long IDs and leading zeros are kept. Free, and your file never leaves your computer.
- Convert CSV, Excel, JSON and XML Files Convert between CSV, Excel, JSON and XML online without losing leading zeros, long IDs or dates. Free; your files are converted in your browser, never uploaded.