FormatterHQ

Excel to XML Converter

Turn spreadsheet rows into XML elements for imports and feeds. Choose the root and row element names, map columns to attributes, and download well-formed XML.

Input CSV
Output XML
Ready.

How to use the Excel to XML Converter

  1. Drop your .xlsx, .xls, .ods or .csv file on the dropzone, or click it to browse.
  2. Pick a sheet by name or number, or tick Convert all sheets. Keep First row is header on so column names become element names.
  3. Set Root element and Array item element to the names your importer expects, and adjust Attribute prefix, XML declaration and Indent.
  4. Click Convert to XML, then check the result and use Copy or Download.

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 &amp; 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 &amp;. 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, column2 and 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: root and item.
  • 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.

Frequently asked questions

How do I make a column an XML attribute?
Start its header text with the attribute prefix, which is @ by default, for example @id. That column is then written as id="…" on each row element instead of as a child element.
Why are my column names changed in the XML?
XML element names cannot contain spaces or most punctuation and cannot start with a digit. The converter replaces invalid characters with underscores and adds a leading underscore where needed, so "Unit price" becomes Unit_price.
Can I export every sheet into one XML file?
Yes. Tick Convert all sheets. All sheets go under the root element, and each row element is named after the sheet it came from.
Does the output follow a specific XML schema?
No. The structure is a generic root, row element and one child per column. Rename the headers and the two element options to match your target format, then validate the result against your schema with your own tools.
Why is an empty cell written as a self-closing tag?
Empty values are kept so that every row has the same set of elements. The tag is shortened to the self-closing form, which XML parsers treat the same as an empty start and end tag pair.

Last updated September 26, 2026

Related tools