Conversion· 10 min read

How to Convert Excel to XML — Complete Guide for Data Imports

XML appears in accounting systems, legacy CRMs, government forms, ERP imports, and document workflows. If your data starts in Excel, producing clean, well-structured XML that another system can reliably parse requires understanding both the format and the receiving system's expectations.

When Excel to XML Conversion Is Needed

XML (Extensible Markup Language) is a text format that represents data as a hierarchy of named tags. Unlike CSV, which is purely flat, XML can represent nested structures and is self-describing — every value is wrapped in a tag that names what it is.

Common scenarios where you need to convert Excel to XML:

  • ERP and accounting imports: SAP, Oracle, and many legacy ERPs accept data via XML feeds rather than CSV.
  • Government and regulatory submissions: Tax authorities, customs agencies, and compliance systems often specify exact XML schemas for data submission.
  • E-commerce product feeds: Google Merchant Center, Amazon Seller Central, and comparison shopping engines accept product catalog XML.
  • Document and content management: CMS platforms, digital asset systems, and publishing workflows often use XML for structured content.
  • System-to-system data exchange: Legacy middleware and integration platforms built before REST APIs became common often rely on XML.

What Excel XML Output Looks Like

For a simple flat table, the most common XML structure maps each row to a record element and each column to a child element:

<?xml version="1.0" encoding="UTF-8"?>
<Records>
  <Record>
    <CustomerName>Acme Corp</CustomerName>
    <Region>North</Region>
    <Revenue>45000</Revenue>
    <OrderDate>2026-06-01</OrderDate>
  </Record>
  <Record>
    <CustomerName>Beta Ltd</CustomerName>
    <Region>South</Region>
    <Revenue>32000</Revenue>
    <OrderDate>2026-06-03</OrderDate>
  </Record>
</Records>

The root element (Records), the row element (Record), and the field elements (CustomerName, Region, etc.) can be named anything — the receiving system usually specifies what names it expects.

CSV vs JSON vs XML: Which One to Use

If you have a choice of output format, pick based on the receiving system's preference:

  • CSV: Simplest. Best for flat tables imported into spreadsheets, databases, or analytics tools. Not suitable for nested data. See the Excel to CSV converter.
  • JSON: Common for REST APIs, web apps, and JavaScript environments. More compact than XML. See the Excel to JSON converter.
  • XML: Best for legacy systems, document workflows, systems that validate against a schema (XSD), and enterprise integration where the schema is predefined and fixed.

If the receiving system can accept multiple formats, prefer CSV or JSON for simplicity. Use XML only when the system specifically requires it.

Preparing Column Headers for XML Output

XML element names have strict rules. Your Excel column headers become XML element names, so they must be:

  • No spaces (use CustomerName or Customer_Name, not Customer Name)
  • No special characters (%, #, &, <, > are invalid or require escaping)
  • Not starting with a number (use Q1Revenue not 1QRevenue)
  • Not starting with the letters "xml" in any case (reserved)
  • Unique within each row (no duplicate column names)
Headers to avoid:    Customer Name, Revenue %, Order Date, #ID
Clean XML headers:   CustomerName, RevenuePercent, OrderDate, RecordID

If the receiving system specifies exact tag names in its documentation or schema, use those exactly — XML parsers are case-sensitive and will reject customerName when they expect CustomerName.

Method 1: Free Excel to XML Tool

For flat worksheet data, the Excel to XML tool is the fastest option:

  1. Upload your Excel workbook.
  2. Choose the sheet to convert.
  3. Preview the XML output to verify the structure.
  4. Download the XML file.

The tool works entirely in your browser — the workbook is not uploaded to any server. It works best for clean tables where row 1 contains headers and each row below is one record. Make sure your headers are XML-compatible before uploading.

Method 2: Excel's Built-In XML Maps

Excel's XML Maps feature is designed for enterprise workflows where the XML schema is defined externally (as an XSD file). This approach maps spreadsheet columns to specific XML elements defined in the schema, ensuring the output conforms exactly to what the receiving system expects.

  1. Enable the Developer tab (File > Options > Customize Ribbon > check Developer).
  2. Go to Developer > XML > Source.
  3. Click XML Maps > Add and load the XSD schema file.
  4. Drag schema elements from the XML Source panel onto the corresponding spreadsheet columns.
  5. Export via Developer > Export.

This method produces XML that validates against the schema. It is the right approach when the receiving system provides an XSD and requires strict conformance.

Method 3: Save As XML Spreadsheet (Not for Data Imports)

Excel can save a file as XML Spreadsheet 2003 (.xml) via File > Save As. This is NOT the same as a data XML. The output includes all workbook metadata — formatting, formulas, sheet structure — wrapped in Microsoft's SpreadsheetML format. It is not suitable for data imports into other systems. Only use this format when you specifically need to share a workbook in an XML-based format that another Excel instance will open.

Handling Special Characters in XML

XML has five reserved characters that must be escaped when they appear inside data values:

  • &&amp;
  • <&lt;
  • >&gt;
  • "&quot; (inside attributes)
  • '&apos; (inside attributes)

Good XML conversion tools handle this automatically. If you are generating XML manually or via a formula, ensure that any cell containing these characters is escaped correctly. A company name like "Johnson & Partners" must appear in the XML as Johnson &amp; Partners.

Encoding: UTF-8 vs Other Encodings

XML files should declare their encoding in the header:

<?xml version="1.0" encoding="UTF-8"?>

UTF-8 is the standard encoding for XML and handles all characters from all languages. If your Excel data contains accented characters (é, ü, ñ), Cyrillic, Chinese, or other non-ASCII text, the XML file must be saved as UTF-8 or those characters will be garbled.

Excel sometimes saves XML with Windows-1252 encoding by default on Windows systems. Verify the output encoding in a plain text editor before sending to a system that expects UTF-8.

Before You Convert: Pre-Flight Checklist

  • Remove blank rows inside the data range — blank rows create empty XML elements.
  • Make every column header unique.
  • Remove spaces and special characters from headers.
  • Format date columns consistently (ISO 8601 format YYYY-MM-DD is safest for XML).
  • Check number formatting — currency symbols and thousands separators in cells may appear as text in XML.
  • Review what the receiving system expects as the root element name, record element name, and field names.

Validating the XML After Conversion

After converting, verify the output before sending it to the receiving system:

  • Open in a browser: Chrome and Firefox render XML as a tree view. If the file is well-formed, you see the tree. If not, you see an error on the first malformed line.
  • Check the first and last record: Confirm the data from row 1 and the last row of your spreadsheet appears correctly in the XML.
  • Check special characters: Find any cell in your data that contains &, <, or > and verify those characters are escaped in the output.
  • Validate against the XSD schema: If the receiving system provided an XSD, use a free XML validator (xmlvalidation.com or similar) to confirm the output validates against the schema before submitting.
  • Test with a small batch first: Import 10-20 records before importing the full file.

Frequently Asked Questions

How do I convert Excel to XML without a plugin?

Use the Excel to XML tool — it runs entirely in your browser with no plugin required. Alternatively, use Excel's built-in XML Maps feature (requires enabling the Developer tab) or write a simple VBA macro to loop through rows and write XML elements.

Can I convert a large Excel file to XML?

Most tools handle files up to a few MB without issues. For very large files (50,000+ rows), processing time increases and browser-based tools may struggle with memory. For large-scale conversions, a server-side script or Power Query to XML is more reliable.

How do I keep Excel date formatting in XML output?

Excel stores dates as serial numbers internally. When converting to XML, ensure the tool formats them as text dates rather than outputting the serial number (e.g., 46000 instead of 2026-01-01). The safest approach: format date columns as text in the format your receiving system expects before converting, or use a TEXT formula (=TEXT(A2,"YYYY-MM-DD")) to create a pre-formatted helper column.

Convert Excel rows to clean XML

Generate XML from your spreadsheet privately in your browser — no upload required.

Open Excel to XML Tool →