All formats

XML to JSONXML Spreadsheet 2003

The Office 2003 XML spreadsheet format.

An XML-based spreadsheet format introduced with Microsoft Office 2003. TabularJS reads sheets, values, formulas (converted to A1 notation), styles, merged cells and plain-text comments.

XML Spreadsheet 2003, also called SpreadsheetML, is the plain XML format Excel offers as "XML Spreadsheet 2003". A file is a <Workbook> with <Worksheet>, <Table>, <Row> and <Cell> elements. Many reporting tools and server scripts still generate it, because it is an easy way to produce a file Excel opens without a library.

Formulas in these files are written in R1C1 notation, like =SUM(R[-2]C:R[-1]C). TabularJS converts them to A1 notation, =SUM(B2:B3), so they match what you see in Excel.

Feature support

Data values
Formulas
Styles
Merged cells
Comments
Column metadata

What TabularJS extracts from XML files

Convert XML to JSON in Node.js

js
import tabularjs from 'tabularjs';

const result = await tabularjs('sales.xml');
const sales = result.worksheets[0];

console.log(sales.data[3]);       // [ 'Total', '=SUM(B2:B3)' ]
console.log(sales.style.A1);      // 'font-family: Calibri; font-size: 11pt; font-weight: bold; background-color: #FFFF00'
console.log(result.definedNames); // { Amounts: 'Sales!R2C2:R3C2' }

Read XML files in the browser

js
import tabularjs from 'tabularjs';

// Reports saved as XML Spreadsheet often have a .xls extension.
// The extension decides the parser, so force the XML one.
const file = document.querySelector('input[type=file]').files[0];
const result = await tabularjs(file, { extension: 'xml' });
console.log(result.worksheets.map((w) => w.worksheetName));

JSON output

json
{
  "worksheets": [
    {
      "worksheetName": "Sales",
      "data": [
        ["Region", "Amount"],
        ["North", 1200],
        ["South", 800],
        ["Total", "=SUM(B2:B3)"],
        ["Checked", ""],
        ["2026-10-01T00:00:00.000", true]
      ],
      "columns": [{ "title": "A", "width": 100 }, { "title": "B", "width": 100 }],
      "mergeCells": { "A5": [2, 1] },
      "comments": { "A3": "Plain comment" },
      "style": { "A1": "font-family: Calibri; font-size: 11pt; font-weight: bold; background-color: #FFFF00" }
    },
    { "worksheetName": "Hidden", "data": [["x"]], "worksheetState": "hidden" }
  ],
  "definedNames": { "Amounts": "Sales!R2C2:R3C2" }
}

Output for a small two-sheet file; only the second sheet and the style of B1 are trimmed.

Limitations

Frequently asked questions

What is the difference between XML Spreadsheet 2003 and XLSX?

XML Spreadsheet 2003 is a single plain XML file. XLSX is a ZIP archive of several XML parts and supports more features, such as charts and images. TabularJS reads both into the same worksheets structure.

Why are the formulas different from the ones in the file?

The file stores them in R1C1 notation, relative to the cell. TabularJS converts them to A1 notation, so =SUM(R[-2]C:R[-1]C) in cell B4 becomes =SUM(B2:B3).

My file has a .xls extension but contains XML. Can TabularJS read it?

Yes. TabularJS picks the parser from the extension, so pass { extension: 'xml' } to use the XML Spreadsheet parser for that file.

Can TabularJS read any XML file as a table?

No. It reads SpreadsheetML documents with <Workbook> and <Worksheet> elements. For other XML, parse the document yourself and build the rows.

Why TabularJS for XML Spreadsheet 2003?