Excel to XML for imports and product feeds
Many older systems still expect XML: ERP and accounting imports, product feeds for marketplaces, catalog uploads for content management systems, and partner integrations defined years ago. This excel to xml converter takes the sheet your team already maintains and writes each row as an XML element, with the header row providing the child element names.
You control the names of the wrapper element and the row element, and you can promote selected columns to attributes. The output is always well-formed: special characters are escaped and header texts are turned into valid XML names.
Example: a price list as an XML feed
Suppose the sheet looks like this, with the SKU column deliberately named @sku in the header:
@sku | Product | Price | 2024 Qty
A-100 | Desk Lamp | 24.5 | 12
B-220 | Monitor Arm & Stand | 89 |
With Root element set to products and Array item element set to product, the converter produces:
<?xml version="1.0" encoding="UTF-8"?>
<products>
<product sku="A-100">
<Product>Desk Lamp</Product>
<Price>24.5</Price>
<_2024_Qty>12</_2024_Qty>
</product>
<product sku="B-220">
<Product>Monitor Arm & Stand</Product>
<Price>89</Price>
<_2024_Qty/>
</product>
</products>
Three things happened here. The @sku column became an attribute because its name starts with the attribute prefix. The ampersand was escaped as &. And the header 2024 Qty was rewritten as _2024_Qty, because an XML element name cannot start with a digit or contain spaces.
Options explained
- Sheet (name or number, blank = first) – selects the tab to convert. Names are case-insensitive; numbers count from 1.
- Convert all sheets – wraps every sheet in one document. Rows of each sheet are then written as elements named after that sheet (a sheet called Staff produces repeated
<Staff>elements under the root). - First row is header – uses row 1 for element names. Blank headings become
column1,column2and so on, and duplicates get_2. When it is off, each row is written as a list of values without column names, which is rarely what an importer wants. - Root element and Array item element – the outer wrapper and the element for each row. Default:
rootanditem. - Attribute prefix – columns whose header starts with this prefix (
@by default) become attributes of the row element. Clear the field and such columns are written as ordinary child elements instead. - XML declaration – adds or omits the
<?xml version="1.0" encoding="UTF-8"?>line. - Indent – 2, 3 or 4 spaces or a tab.
How cell values are written
Every value ends up as text, because XML has no data types of its own. Numbers are written as Excel stores them, without currency or thousands formatting; 89.00 in a formatted cell is 89. Booleans become true or false, and date cells become 2024-03-15-style dates, or ISO timestamps when a time is present. Empty cells produce self-closing elements such as <_2024_Qty/>, so the element is still present for importers that require every field.
Header text is cleaned the same way for every column: characters outside letters, digits, underscore, hyphen, period and colon are replaced with an underscore, and a name starting with a digit or with the letters xml gets a leading underscore.
Common problems
- The importer rejects element names. Rename the header cells in Excel to exactly the names in the target schema; that is easier than renaming elements afterwards.
- Nesting is required. This tool writes one level of fields per row. If the target format needs nested groups, convert with Excel to JSON, restructure the data, and use JSON to XML.
- Checking the result. Paste the output into the XML validator or pretty-print it with a different indent before sending it to a partner.
Privacy
The workbook is opened in your browser and the XML is produced there as well; the file is not sent to our server. Nothing is stored unless you use Save & Share.