TabularJS vs read-excel-file
read-excel-fileis a focused library for one job: reading .xlsx files in the browser or Node.js. It returns typed values (numbers, booleans, Date objects) and has aschema option that turns rows into validated objects. TabularJS is a reader for many spreadsheet formats (XLSX, XLS, ODS, CSV, HTML tables and older formats) behind a single await tabularjs(file) call, returning every worksheet as a 2D array.
Everything on this page was run against read-excel-file 9.3.13 and tabularjs 2.2.0 on the same test files. If your users only upload .xlsx, read-excel-file is smaller and gives you typed objects out of the box. If they upload whatever their tools export, TabularJS reads it with one code path.
At a glance
| Feature | read-excel-file | TabularJS |
|---|---|---|
| Formats read | .xlsx only | XLSX, XLS, ODS, CSV, TSV, TXT, HTML tables, XML Spreadsheet 2003, SYLK, DIF, DBF, Lotus 1-2-3, Numbers (experimental) |
| Main call | readSheet(file) for one sheet; default export for all sheets | await tabularjs(file), always all sheets |
| Row output | 2D array of string, number, boolean, Date or null | 2D array in worksheets[i].data |
| Rows to typed objects | Yes: schema with type, required, oneOf, validate | No: map rows yourself |
| Dates | Date objects | Excel serial numbers, number format in cells[address].format |
| Formula cells | Value saved by Excel | Formula text, e.g. "=SUM(D2:D4)" |
| Empty cells | null | '' (empty string) |
| Text cells | Trimmed by default (trim: false to keep) | Kept as is |
| Trailing empty rows | Dropped | Kept up to the sheet dimension |
| Input (browser) | File, Blob, ArrayBuffer | File, Blob, ArrayBuffer, Uint8Array, HTML string, DOM element |
| Input (Node.js) | Path, Stream, Buffer, Blob | Path, Buffer, Uint8Array, Blob |
| Web Worker build | Yes (read-excel-file/web-worker) | No |
| Bundle size (min / gzip) | ~69 KB / ~20 KB | ~199 KB / ~67 KB |
| Runtime dependencies | 4 (fflate, saxen, unzipper-esm, worker-f) | 2 (jszip, @lemonadejs/html-to-json) |
| License | MIT | MIT |
| Writes files | No (separate write-excel-file package) | No |
| Latest version | 9.3.13, Oct 27, 2026 | 2.2.0, Oct 29, 2026 |
Bundle size: a one-line entry (import x from 'pkg'; window.x = x;, usingreadSheet from read-excel-file/browser) bundled withesbuild --bundle --minify --platform=browser --format=esm (esbuild 0.28.2), then gzip -9. Measured 69,062 / 20,005 bytes for read-excel-file and 199,340 / 66,754 bytes for tabularjs.
Same task: read an uploaded file
Both read a File from an <input type="file"> without extra conversion.
import { readSheet } from 'read-excel-file/browser';
input.addEventListener('change', async (e) => {
// First sheet, as an array of rows
const rows = await readSheet(e.target.files[0]);
render(rows);
});import tabularjs from 'tabularjs';
input.addEventListener('change', async (e) => {
const result = await tabularjs(e.target.files[0]);
render(result.worksheets[0].data);
});In Node.js, read-excel-file is imported from read-excel-file/node and accepts a path, stream or Buffer; tabularjs is the same import everywhere and accepts a path, Buffer or Uint8Array.
Output for the same file
Test workbook: a People sheet with a header row, a date column formattedyyyy-mm-dd, booleans, a number column, formulas in the Totalcolumn (=D2*2, =D3*2, and =SUM(D2:D4) in E5), empty cells, a name with surrounding spaces, and a second sheet named Totals.
// await readSheet(file)
[
['Name', 'Born', 'Married', 'Kids', 'Total'],
['John Smith', new Date('1995-01-01T00:00:00.000Z'), true, 3, 6],
['Kate Brown', new Date('2010-03-01T00:00:00.000Z'), false, 0, 0],
['Ann Lee', null, true, null, null],
[null, null, null, null, 3]
]// (await tabularjs(file)).worksheets[0]
data: [
['Name', 'Born', 'Married', 'Kids', 'Total'],
['John Smith', 34700, true, 3, '=D2*2'],
['Kate Brown', 40238, false, 0, '=D3*2'],
[' Ann Lee ', '', true, '', ''],
['', '', '', '', '=SUM(D2:D4)']
]
cells.B2: { format: 'yyyy-mm-dd' }
columns[0]: { title: 'A', ... }- Dates. read-excel-file detects date formats and returns
Dateobjects. TabularJS returns the stored serial number (34700) and the format string, so you convert it. - Formulas. Neither evaluates formulas. read-excel-file gives you the value Excel saved (6); TabularJS gives you the formula text (
"=D2*2") and not the saved value. - Empty cells.
nullvs''. - Whitespace. read-excel-file trims text by default (
"Ann Lee"); TabularJS keeps it (" Ann Lee "). - Header row. Both keep it as the first row of the array. TabularJS
columns[i].titleholds the column letter (A,B, ...), not the header text. - Trailing empty rows. On a real-world sample, read-excel-file returned 39 rows and 10 columns; TabularJS returned 42 rows and 11 columns, padding with empty cells to the sheet's declared size.
Multiple sheets
import readExcelFile from 'read-excel-file/browser';
const sheets = await readExcelFile(file);
// [{ sheet: 'People', data: [...] }, { sheet: 'Totals', data: [...] }]
// Or one sheet by number (from 1) or name:
const totals = await readSheet(file, 'Totals');import tabularjs from 'tabularjs';
const { worksheets } = await tabularjs(file);
// [{ worksheetName: 'People', data: [...], ... },
// { worksheetName: 'Totals', data: [...], ... }]
const totals = worksheets.find((ws) => ws.worksheetName === 'Totals');Typed objects: schema vs mapping by hand
This is read-excel-file's strongest feature. A schema maps header titles to properties, checks types and required values, and reports errors with row and column. Errors are all-or-nothing: with any error, objects is undefined. In our test, the formula-only last row has no Name, so the call returned onerequired error for row 4.
import { readSheet } from 'read-excel-file/browser';
const schema = {
name: { column: 'Name', type: String, required: true },
born: { column: 'Born', type: Date },
kids: { column: 'Kids', type: Number },
};
const { objects, errors } = await readSheet(file, { schema });
// errors: [{ error: 'required', column: 'Name', row: 4, ... }]
// objects is undefined when there is any errorTabularJS has no schema. The same objects take a few lines, including the date conversion, and you add validation yourself:
import tabularjs from 'tabularjs';
// Excel stores dates as day counts (1900 date system)
const excelDate = (serial) => new Date(Math.round((serial - 25569) * 86400000));
const { worksheets } = await tabularjs(file);
const [header, ...rows] = worksheets[0].data;
const col = (title) => header.indexOf(title);
const objects = rows
.filter((row) => row[col('Name')] !== '')
.map((row) => ({
name: String(row[col('Name')]).trim(),
born: row[col('Born')] === '' ? null : excelDate(row[col('Born')]),
kids: row[col('Kids')] === '' ? null : Number(row[col('Kids')]),
}));
// [{ name: 'John Smith', born: Date(1995-01-01), kids: 3 }, ...]The serial-to-date conversion assumes the default 1900 date system and dates after February 1900. This is also the migration path if you move from read-excel-file to TabularJS: replace readSheet(file, { schema }) with a mapping like the one above.
When to choose read-excel-file
- Your input is always
.xlsx. - You want typed, validated objects from a known column layout; the
schemaoption does this with error reporting per row and column. - You want
Dateobjects and the saved results of formula cells without extra code. - Bundle size matters: about 20 KB gzipped against about 67 KB for TabularJS.
- You want a ready-made Web Worker entry point or to read from a Node.js stream.
When to choose TabularJS
- Users upload
.xls,.ods,.csvor other formats as well as.xlsx, and you want one code path. Format is detected from the content when the extension is missing or wrong. - You need the formulas themselves (as text), number formats, merged cells or cell comments, not just values.
- You render the data in Jspreadsheet: the result object is the shape
jspreadsheet()takes, so it can be passed straight in. - You also need HTML tables or legacy formats such as DBF, SYLK, DIF or Lotus 1-2-3.
Frequently asked questions
Can read-excel-file read .xls, .ods or .csv files?
No. read-excel-file reads .xlsx only. In our test, version 9.3.13 threw InvalidInputError (code XLS_FILE_NOT_SUPPORTED) for an .xls file, InvalidInputError (FILE_NOT_SUPPORTED) for a .csv file, and InvalidSpreadsheetError for an .ods file. TabularJS read all three with the same call it uses for .xlsx.
Which one is smaller?
read-excel-file. Bundled and minified with esbuild for the browser, importing readSheet from read-excel-file/browser came to about 69 KB minified and 20 KB gzipped. Importing tabularjs came to about 199 KB minified and 67 KB gzipped, because it ships parsers for 16+ formats in one function.
Does either library calculate formulas?
Neither evaluates formulas. read-excel-file returns the result that Excel saved in the file (6 for =D2*2). TabularJS returns the formula text ("=D2*2") in data and does not give you the saved result, so if you need computed values from formula cells, read-excel-file is the better fit.
How are dates returned?
read-excel-file returns JavaScript Date objects for cells with a date number format. TabularJS returns the Excel serial number (for example 34700 for 1995-01-01) and puts the number format in worksheets[i].cells[address].format, so you convert dates yourself.
Does TabularJS have a schema or validation feature like read-excel-file?
No. TabularJS returns rows as a 2D array; mapping rows to objects and validating them is up to you (a few lines of code, or a validation library such as zod). read-excel-file can map columns to typed objects, check required values and allowed values, and report errors with row and column.
Why does import readXlsxFile from "read-excel-file" no longer work?
read-excel-file had three major releases in 2026 (7.0 in February, 8.0 in March, 9.0 in April). In 7.x the browser entry moved to read-excel-file/browser; in 8.x the default export was replaced by the named export readSheet and the schema option was moved out (9.x added it back to readSheet). In 9.3.13 the package exposes only read-excel-file/browser, /node, /universal and /web-worker, and importing the bare name fails with ERR_PACKAGE_PATH_NOT_EXPORTED. Tutorials that use readXlsxFile(file, { schema }) describe the pre-8.x API.
Can I write Excel files with either library?
Both are read-only. The read-excel-file author publishes a separate package, write-excel-file, for writing .xlsx. TabularJS has no writer.
Try it on your own files
Install with npm install tabularjs and read any supported file with one call.