JavaScript libraries to read Excel files
We installed seven npm packages that read .xlsx files and ran each one on the same workbook on 2026-10-29. This page lists what they read and write, where they run, how big they are, and what they actually returned for formulas, dates and styles. There is no overall winner: the right library depends on what you need to do.
Disclosure: TabularJS is our library. The numbers below come from the same scripts for every package; see how we tested.
Quick recommendation by use case
- You need to write or edit .xlsx files (reports, styles, formulas):ExcelJS orSheetJS (from the SheetJS CDN, not npm). To fill in an existing template and keep its formatting,xlsx-populate does that, but its last release was in 2020.
- You read only .xlsx and want objects validated against a schema, with the smallest bundle:read-excel-file.
- Users upload many formats (XLSX, XLS, ODS, CSV, HTML, DBF, Lotus…) and you want one output shape:TabularJS. It does not write files, and it returns formulas as text, not computed values.
- You need many formats and writing:SheetJS 0.20.3 from cdn.sheetjs.com.
- A quick Node script that dumps a workbook to arrays:node-xlsx (a thin wrapper over SheetJS 0.20.2). Avoidconvert-excel-to-json for files from users: it ships SheetJS 0.12.13.
Comparison table
| Library | Reads | Writes | Runs in | License | Weekly downloads | Latest version | Browser bundle (gzip) |
|---|---|---|---|---|---|---|---|
| SheetJS (xlsx) | XLSX, XLSM, XLSB, XLS, ODS, CSV, HTML, SYLK, DIF, DBF, Lotus, Numbers and more | Yes (most of the same formats) | Node, browser | Apache-2.0 | 12,805,212 | 0.18.5 on npm (2022-03-24); 0.20.3 on cdn.sheetjs.com | 142.3 kB (0.18.5) / 162.0 kB (0.20.3) |
| ExcelJS | XLSX; CSV through a separate API | Yes (XLSX, CSV) | Node, browser (no streaming reader/writer in the browser) | MIT | 20,979,265 | 4.4.0 (2023-10-19) | 269.9 kB |
| read-excel-file | XLSX only | No (read-only) | Node, browser, web worker | MIT | 3,626,171 | 9.3.13 (2026-10-27) | 19.3 kB |
| node-xlsx | Whatever SheetJS reads (it wraps SheetJS 0.20.2) | Yes (xlsx.build) | Node | Apache-2.0 | 494,186 | 0.24.0 (2024-04-15) | n/a: imports fs (159.1 kB as a Node bundle) |
| xlsx-populate | XLSX only | Yes (XLSX, keeps existing formatting) | Node, browser (prebuilt browser file) | MIT | 234,886 | 1.21.0 (2020-03-01) | 209.3 kB (prebuilt browser/xlsx-populate.js) |
| convert-excel-to-json | Whatever SheetJS 0.12.13 reads | No (JSON output only) | Node, CLI | MIT | 49,264 | 1.7.0 (2020-06-08) | n/a: Node file API (352.4 kB as a Node bundle) |
| TabularJS | XLSX, XLS, ODS, CSV, TSV, TXT, HTML tables, XML 2003, SYLK, DIF, DBF, Lotus (WKS/WK1/WK3/WK4/123) | No (read-only) | Node, browser | MIT | 551 | 2.2.0 (2026-10-29) | 66.6 kB |
Downloads: npm API, week of 2026-10-21 to 2026-10-27. Versions and dates: npm view on 2026-10-29. Bundle: one-line import bundled with esbuild 0.28.2 (--bundle --minify --format=esm --platform=browser), then gzip -9. Download counts include installs pulled in as dependencies of other packages.
What happened on the same .xlsx file
The test file is a real lab calculation workbook: 5 sheets (4 of them hidden, including the first one, "Flow"), 170 formulas and 53 merged ranges on the first sheet. Cell Flow!D6 holds=IF(C6>0,(C6-B6),"") with a saved value of 0.49801. The workbook has no date cells, so for dates we used a second file with one date cell (2026-01-15, formatyyyy-mm-dd), one formula and one bold cell.
| Library | Rows (first sheet) | Formula cell Flow!D6 | Date cell | Styles | Merged cells |
|---|---|---|---|---|---|
| SheetJS 0.18.5 / 0.20.3 | 42 | Both: v = 0.498…, f = IF(C6>0,(C6-B6),""), w = "0.49801" | Serial 46037 with formatted text "2026-01-15"; a Date with cellDates: true | No fonts in the free build (cellStyles returned only a fill pattern) | 53 (in !merges) |
| ExcelJS 4.4.0 | 42 | Both: { formula: 'IF(C6>0,(C6-B6),"")', result: 0.498… } | Date object | Yes (font, fill, borders per cell) | 53 |
| read-excel-file 9.3.13 | 39 (trailing empty rows dropped) | Cached value only: 0.498… | Date object | No | No |
| node-xlsx 0.24.0 | 42 | Cached value only: 0.498… | Serial number 46037 | No | Not in the default output |
| xlsx-populate 1.21.0 | 42 | Both: cell.value() and cell.formula() | Serial 46037; the number format is readable with style("numberFormat") | Yes (cell.style("bold") and others) | Not tested |
| convert-excel-to-json 1.7.0 | 34 (empty rows skipped; objects keyed A, B, C…) | Cached value only: 0.498… | Date object | No | No |
| TabularJS 2.2.0 | 42 | Formula text only: '=IF(C6>0,(C6-B6),"")', no computed value | Serial number 46037 | Yes, as CSS strings (372 styled cells) | 53 (in mergeCells) |
- Every library returned all 5 sheets, hidden ones included, and every one put the hidden "Flow" sheet first. If you read "the first sheet", check which sheet that is.
- No library evaluates formulas. Most return the value Excel saved in the file; TabularJS returns the formula text instead, so if you need computed values from formula cells, it is the wrong tool today.
- Dates in .xlsx are numbers with a date format. Some libraries convert them to
Dateobjects, others give you the serial number. Converting a serial is one line:
// Excel serial number (1900 date system) to a JavaScript Date in UTC
const toDate = (serial) => new Date(Math.round((serial - 25569) * 86400000));
toDate(46037).toISOString(); // '2026-01-15T00:00:00.000Z'Same workbook saved as .xls, .ods and .csv
| Library | test1.xls | test1.ods | test1.csv |
|---|---|---|---|
| SheetJS 0.18.5 | 5 sheets | Error: "Unsupported value type error" | 1 sheet |
| ExcelJS 4.4.0 | Error (not a zip file) | 0 sheets, no error | 52 rows (workbook.csv) |
| read-excel-file 9.3.13 | Error: legacy .xls not supported | Error | Error |
| node-xlsx 0.24.0 | 5 sheets | Error: "Unsupported value type error" | 1 sheet |
| xlsx-populate 1.21.0 | Error | Error | Error |
| convert-excel-to-json 1.7.0 | 5 sheets | Error: "Unsupported value type error" | 1 sheet |
| TabularJS 2.2.0 | 5 sheets | 5 sheets | 1 sheet |
SheetJS supports ODS in general; this particular .ods contains error cells (such as#DIV/0!), and SheetJS 0.18.5 and 0.20.3 both threw on them.
The libraries
SheetJS (xlsx)
The broadest format support of the group, for both reading and writing, and the long-time default. The catch is distribution: the xlsx package on npm stopped at 0.18.5 (2022-03-24), which has two unpatched high-severity advisories, CVE-2023-30533 and CVE-2024-22363. Newer releases are published only on cdn.sheetjs.com. Style reading and some other features are in the paid Pro edition. Details:the xlsx npm vulnerability.
# npm still serves 0.18.5; current releases come from the SheetJS CDN
npm install https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgzimport * as XLSX from 'xlsx';
import fs from 'fs';
const workbook = XLSX.read(fs.readFileSync('./file.xlsx'));
const sheet = workbook.Sheets[workbook.SheetNames[0]];
const rows = XLSX.utils.sheet_to_json(sheet, { header: 1 });ExcelJS
The most downloaded package here and the usual choice for generating styled .xlsx files: fonts, fills, borders, formulas, data validation, streaming writes in Node. It reads styles back as well. It reads only .xlsx (and CSV through workbook.csv), it is the largest browser bundle we measured, and the last release was 4.4.0 in October 2023. npm audit flags a moderate advisory in its uuid dependency.
import ExcelJS from 'exceljs';
const workbook = new ExcelJS.Workbook();
await workbook.xlsx.readFile('./file.xlsx');
workbook.worksheets[0].eachRow((row) => {
console.log(row.values); // 1-based: row.values[0] is empty
});read-excel-file
Reads .xlsx only, and does it with the smallest bundle in the group. It converts date cells to Date objects and can map rows to objects with a schema that checks required fields and types. It is actively maintained (9.3.13 was released two days before our test). It rejects .xls, .ods and .csv files with a clear error.
import { readSheet } from 'read-excel-file/node';
// In the browser: import { readSheet } from 'read-excel-file/browser';
const rows = await readSheet('./file.xlsx'); // first sheet, 2D arraynode-xlsx
A small wrapper around SheetJS with a simpler API: parse() returns[{ name, data }] and build() writes a file. Version 0.24.0 depends on SheetJS 0.20.2 from cdn.sheetjs.com, not the npm 0.18.5, so npm audit did not flag it. It imports fs, so it is for Node only.
import xlsx from 'node-xlsx';
const sheets = xlsx.parse('./file.xlsx'); // [{ name, data }]
console.log(sheets[0].data);xlsx-populate
Built to open an existing .xlsx, change values and save it without losing the formatting, with a jQuery-like chaining API and support for password-protected files. It returns both the formula and the saved value. It reads only .xlsx, and the last release (1.21.0) is from March 2020. In the browser you load its prebuilt file; bundling the package entry for the browser failed because it requires fs and crypto.
import XlsxPopulate from 'xlsx-populate';
const workbook = await XlsxPopulate.fromFileAsync('./file.xlsx');
const rows = workbook.sheet(0).usedRange().value();convert-excel-to-json
A Node API and CLI that returns one array of objects per sheet, keyed by column letter, with options for ranges, header rows and column-to-key mapping. It depends on SheetJS^0.12.1 (0.12.13 installed), which npm audit flags with high-severity advisories, and has not been released since 2020. Fine for your own files; we would not run it on uploads.
import excelToJson from 'convert-excel-to-json';
const result = excelToJson({ sourceFile: './file.xlsx' });
// { Sheet1: [{ A: 'Name', B: 'Email' }, { A: 'Ann', B: '[email protected]' }] }TabularJS
One async function that reads XLSX, XLS, ODS, CSV, TSV, TXT, HTML tables, XML 2003, SYLK, DIF, DBF and Lotus files and returns the same shape for all of them:result.worksheets[i] with worksheetName, data (2D array) and columns, plus merged cells and styles where the format has them. It was the only library in the test that read all three of the .xls, .ods and .csv files. It is MIT licensed and read-only. Know the limits: formulas come back as text and are never evaluated, .xlsx dates are serial numbers, CSV values are strings, and the package is new (551 downloads in the test week).
import tabularjs from 'tabularjs';
// A path in Node; a File, Blob or ArrayBuffer in the browser
const result = await tabularjs('./file.xlsx');
const rows = result.worksheets[0].data; // 2D arrayHow we tested
- Date: 2026-10-29. Node.js 24.15.0 on Windows 11.
- Versions: xlsx 0.18.5 (npm) and 0.20.3 (cdn.sheetjs.com), exceljs 4.4.0, read-excel-file 9.3.13, node-xlsx 0.24.0 (with xlsx 0.20.2), xlsx-populate 1.21.0, convert-excel-to-json 1.7.0 (with xlsx 0.12.13), tabularjs 2.2.0.
- Input:
test1.xlsxfrom the TabularJS samples folder, the same workbook saved as.xls,.odsand.csv, and a one-row.xlsxwritten with ExcelJS for the date, formula and bold checks. - Each library was called with its default options through its documented read API, the same code as the examples above.
- Weekly downloads from
https://api.npmjs.org/downloads/point/last-week/<package>; versions and dates fromnpm view; advisories fromnpm audit. - Bundle size: an entry file with one import, bundled with esbuild 0.28.2 using
--bundle --minify --format=esm --platform=browser, thengzip -9. ExcelJS resolves to its prebuiltdist/exceljs.min.jsthrough its browser field; xlsx-populate was measured from its prebuiltbrowser/xlsx-populate.js; read-excel-file fromread-excel-file/browser. node-xlsx and convert-excel-to-json are Node packages, so we list their Node bundle size for reference only.
FAQ
What is the best JavaScript library to read Excel files?
It depends on the job. To write or edit .xlsx files, use ExcelJS or SheetJS. To read only .xlsx files into objects with a schema and a small browser bundle, use read-excel-file. To accept many input formats (XLS, ODS, CSV, HTML, DBF, Lotus and others) and get one output shape, use TabularJS, which is read-only.
Is the xlsx package on npm safe to use?
The latest xlsx on npm is 0.18.5, published on 2022-03-24. npm audit reports two high-severity advisories for it, CVE-2023-30533 (prototype pollution) and CVE-2024-22363 (ReDoS). SheetJS publishes newer versions (0.20.3 when we tested) only on cdn.sheetjs.com, so install from there if you use SheetJS.
How do I convert an Excel file to JSON in Node.js?
With TabularJS: const result = await tabularjs('./file.xlsx') gives result.worksheets[0].data as a 2D array. With SheetJS: XLSX.utils.sheet_to_json(sheet). With read-excel-file: await readSheet('./file.xlsx'). With convert-excel-to-json: excelToJson({ sourceFile }) returns one array of objects per sheet, keyed by column letter.
Which library has the smallest browser bundle?
In our measurement (esbuild bundle and minify, then gzip): read-excel-file 19.3 kB (XLSX only), TabularJS 66.6 kB, SheetJS 142.3 kB (0.18.5) or 162.0 kB (0.20.3), xlsx-populate 209.3 kB and ExcelJS 269.9 kB.
Do these libraries calculate formulas?
None of them evaluates formulas. SheetJS, ExcelJS and xlsx-populate return both the formula and the value that Excel saved in the file. read-excel-file, node-xlsx and convert-excel-to-json return only the saved value. TabularJS returns only the formula text, such as =SUM(A1:A3), and no computed value.
Which libraries can read .xls and .ods files?
In our test, SheetJS, node-xlsx and convert-excel-to-json read the .xls file, and TabularJS read both .xls and .ods. ExcelJS, read-excel-file and xlsx-populate read neither (ExcelJS returned an empty workbook for the .ods without an error). The SheetJS-based libraries threw an error on our .ods file, which contains error cells.
Which libraries can write Excel files?
SheetJS, ExcelJS, xlsx-populate and node-xlsx can write .xlsx files. read-excel-file, convert-excel-to-json and TabularJS only read.
Reading uploads in many formats?
TabularJS reads 16+ spreadsheet formats into one JSON shape, in Node and the browser.