All tools
Free · Private · No upload

Convert Excel to XML Online

Convert an Excel sheet into a simple, flat XML document with one element per row. The workbook is opened in your browser and never uploaded.

Drop a CSV or Excel file here

CSV · XLSX · XLS · XLSM · XLSB

or paste your data below

How to convert Excel to XML

Three steps from catalog.xlsx to XML.

1. Drop the workbook

Drop an .xlsx, .xls, .xlsm or .xlsb file, or paste cells copied from Excel.

2. Check it in the grid

Rename headers that would make awkward tag names: "Item No" becomes <Item_No>, and a header starting with a digit gets a col_ prefix.

3. Name the tags

Set the root and row tag names, choose elements or attributes, toggle pretty printing, then copy or download data.xml.

Example: Excel in, XML out

A catalogue sheet with a spaced header ("Item No"), an ampersand and a VAT formula (=C2*0.25).

catalog.xlsx, sheet "Items" (the "Categories" sheet is left out)
ABCD
1Item NoNamePriceVAT
21001Notebook4.4=C2*0.25
31002Pen & pencil set7.2=C3*0.25
data.xml (default options)
<?xml version="1.0" encoding="UTF-8"?>
<rows>
  <row>
    <Item_No>1001</Item_No>
    <Name>Notebook</Name>
    <Price>4.4</Price>
    <VAT>1.1</VAT>
  </row>
  <row>
    <Item_No>1002</Item_No>
    <Name>Pen &amp; pencil set</Name>
    <Price>7.2</Price>
    <VAT>1.8</VAT>
  </row>
</rows>

VAT holds the calculated 1.1 and 1.8. The output is plain data XML, not Excel's own SpreadsheetML or the XML inside an .xlsx, and that is usually what an importer wants.

What changes between Excel and XML

Tag names come from headers

Column elements are named after the headers, made safe for XML: "Item No" becomes <Item_No>. A header starting with a digit gets a col_ prefix.

Attributes mode

Each row becomes one empty element with an attribute per column: <row Item_No="1001" Name="Notebook" Price="4.4" VAT="1.1"/>

Formulas become results

The grid calculates formulas, so VAT gets the result (1.1), not the formula text (=C2*0.25). Values are taken as the grid shows them, so check date and number columns there first.

When to convert Excel to XML

Excel to XML in JavaScript

TabularJS reads every sheet; the snippet picks one by name. Then headers become tag names and values are escaped for XML.

import tabularjs from 'tabularjs';

const { worksheets } = await tabularjs('catalog.xlsx');
const sheet = worksheets.find((ws) => ws.worksheetName === 'Items');
const [header, ...rows] = sheet.data; // VAT arrives as "=C2*0.25"

const tag = (h) => String(h).trim().replace(/[^A-Za-z0-9_]/g, '_');
const esc = (v) => String(v ?? '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
console.log('<?xml version="1.0" encoding="UTF-8"?>\n<rows>\n' + rows.map((row) =>
  '  <row>\n' + header.map((h, i) => `    <${tag(h)}>${esc(row[i])}</${tag(h)}>`).join('\n') + '\n  </row>'
).join('\n') + '\n</rows>');

Unlike this page, TabularJS does not calculate formulas: VAT comes back as "=C2*0.25". Dates arrive as serial numbers (45414 is 2024-05-02).

npm install tabularjs MIT licensed

Frequently asked questions

Does the XML keep Excel's data types?

XML text has no types, so 4.4 is written as <Price>4.4</Price>. If the receiver needs types, it has to apply them from a schema of its own.

Are the element names taken from the sheet name?

No. Type any names you like in Root tag and Row tag, for example items and item. Only the column elements come from the sheet, from its header row.

Which Excel files can I open?

.xlsx, .xlsm, .xlsb and the older .xls, plus .ods from LibreOffice. You can also copy a range in Excel and paste it into the box.

Should I use elements or attributes?

Elements are easier to read and handle long text or line breaks well. Attributes give one compact line per row, which many feed and config formats prefer. Pick whatever the receiving system expects.

Does catalog.xlsx get uploaded when I convert it to XML?

No. The workbook is opened in your browser and never uploaded.