# Why xlsx-format?

Source: /xlsx-format/guide/why-xlsx-format

Most projects just need XLSX. A focused library keeps the bundle and workbook API small while leaving file-system I/O to the host application.

xlsx-format does one thing well: read and write modern Excel files. The result is a library you can actually tree-shake, `await`, and ship to the browser without a separate bundle.

## Comparison

|                     | **xlsx-format 2.4.2**           | **SheetJS 0.18.12**      | **ExcelJS 4.4.0**                |
| ------------------- | ------------------------------- | ------------------------ | -------------------------------- |
| **Written in**      | TypeScript (strict)             | JavaScript with typings  | JavaScript with TypeScript types |
| **Async**           | Promise-based API               | Synchronous public API   | Promise-based selected APIs      |
| **Module format**   | ESM + CJS                       | ESM + CJS                | CJS + browser build              |
| **Tree-shakeable**  | Yes                             | Limited                  | Limited                          |
| **Browser support** | Yes (`read` / `write`)          | Yes (separate bundle)    | Yes (`exceljs.browser.js`)       |
| **Formats**         | XLSX / XLSM¹ / CSV / TSV / HTML | Many spreadsheet formats | XLSX / CSV                       |
| **Styled reports**  | Yes                             | Yes                      | Yes                              |
| **API style**       | Named exports                   | Namespace object         | Class-based                      |
| **License**         | Apache 2.0                      | Apache 2.0               | MIT                              |

The version labels identify the snapshots used for this orientation table. The [SheetJS package metadata](https://github.com/SheetJS/sheetjs/blob/master/package.json) advertises ESM/CJS entry points and browser bundles. ExcelJS documents its browser build and workbook API in its [browser documentation](https://github.com/exceljs/exceljs#browser).

## Feature Support

¹ XLSM support covers workbook cell data and macro-free output containers. VBA projects are not read, preserved, or written. Do not use an XLSM read/write round trip when macros must survive unchanged.

What xlsx-format can read from and write to XLSX files at a glance.

### Cell Data

| Feature      | Read | Write | Notes                                           |
| ------------ | :--: | :---: | ----------------------------------------------- |
| Strings      | Yes  |  Yes  | Via shared string table or inline               |
| Numbers      | Yes  |  Yes  | Full floating-point precision                   |
| Booleans     | Yes  |  Yes  | Native boolean cell type                        |
| Dates        | Yes  |  Yes  | Serial numbers or ISO 8601 (`cellDates` option) |
| Error values | Yes  |  Yes  | `#NULL!`, `#DIV/0!`, `#VALUE!`, etc.            |

### Formulas

| Feature         | Read | Write | Notes                                                    |
| --------------- | :--: | :---: | -------------------------------------------------------- |
| Cell formulas   | Yes  |  Yes  | Stored in `cell.f`                                       |
| Array formulas  | Yes  |  Yes  | Range reference in `cell.F`, dynamic array flag `cell.D` |
| Shared formulas | Yes  |  --   | Expanded to individual cell formulas on read             |

### Number Formats

| Feature             | Read | Write | Notes                                           |
| ------------------- | :--: | :---: | ----------------------------------------------- |
| Built-in formats    | Yes  |  Yes  | 164+ standard Excel format codes                |
| Custom formats      | Yes  |  Yes  | e.g. `#,##0.00`, `yyyy-mm-dd`, custom patterns  |
| Format display text | Yes  |  Yes  | Formatted value in `cell.w` via full SSF engine |

### Styles

| Feature                                    | Read | Write | Notes                                                |
| ------------------------------------------ | :--: | :---: | ---------------------------------------------------- |
| Rich text (bold, italic, underline, color) | Yes  |  Yes  | Preserved in shared strings                          |
| Cell number format references              | Yes  |  Yes  | Style index maps to format codes                     |
| Cell fonts                                 | Yes  |  Yes  | Name, size, bold, and RGB/ARGB color                 |
| Solid fills                                | Yes  |  Yes  | Foreground color for title rows, headers, and totals |
| Borders                                    | Yes  |  Yes  | Top, right, bottom, left with `thin` or `medium`     |
| Alignment                                  | Yes  |  Yes  | Horizontal, vertical, and wrap text                  |

### Comments

| Feature           | Read | Write | Notes                                |
| ----------------- | :--: | :---: | ------------------------------------ |
| Legacy comments   | Yes  |  Yes  | ECMA-376 format with VML positioning |
| Threaded comments | Yes  |  Yes  | Modern reply-chain format            |
| Comment authors   | Yes  |  Yes  | Author list and people mapping       |

### Hyperlinks

| Feature        | Read | Write | Notes                      |
| -------------- | :--: | :---: | -------------------------- |
| External URLs  | Yes  |  --   | Parsed from relationships  |
| Internal links | Yes  |  --   | `#Sheet2!A1` syntax        |
| Tooltips       | Yes  |  --   | Stored in `cell.l.Tooltip` |

### Sheet Structure

| Feature               | Read | Write | Notes                                        |
| --------------------- | :--: | :---: | -------------------------------------------- |
| Multiple sheets       | Yes  |  Yes  | Ordered sheet list with unique names         |
| Merge regions         | Yes  |  Yes  | Rectangular merge ranges                     |
| Column widths         | Yes  |  Yes  | Character-unit widths                        |
| Row heights           | Yes  |  Yes  | Point-based heights                          |
| Hidden columns / rows | Yes  |  Yes  | Via `hidden` flag                            |
| Frozen panes          | Yes  |  Yes  | Top rows and/or left columns via `!views`    |
| Auto-filter range     | Yes  |  Yes  | Filter range definition (no filter criteria) |
| Page margins          | Yes  |  Yes  | Left, right, top, bottom, header, footer     |

### Workbook & Metadata

| Feature                 | Read | Write | Notes                                |
| ----------------------- | :--: | :---: | ------------------------------------ |
| Sheet visibility        | Yes  |  Yes  | Visible, hidden, very hidden         |
| Defined names           | Yes  |  Yes  | Workbook-scoped and sheet-scoped     |
| Document properties     | Yes  |  Yes  | Title, author, dates, keywords, etc. |
| Custom properties       | Yes  |  Yes  | User-defined key/value pairs         |
| Date system (1904 mode) | Yes  |  Yes  | Mac Excel legacy support             |
| Dynamic array metadata  | Yes  |  Yes  | XLDAPR spill-range support           |

### Format Conversion

| Feature          | Read | Write | Notes                                         |
| ---------------- | :--: | :---: | --------------------------------------------- |
| JSON objects     | Yes  |  Yes  | `sheetToJson` / `jsonToSheet`                 |
| Arrays of arrays | Yes  |  Yes  | `sheetToJson({ header: 1 })` / `arrayToSheet` |
| CSV              | Yes  |  Yes  | `csvToSheet` / `sheetToCsv`                   |
| TSV              | Yes  |  Yes  | Via separator option                          |
| HTML tables      | Yes  |  Yes  | `htmlToSheet` / `sheetToHtml`                 |

### Not Yet Supported

Conditional formatting, data validation, charts, images, pivot tables, sparklines, VBA macros, custom theme XML, calculation-chain exposure, raw ZIP entry exposure, digital signatures, sheet/workbook protection, outline grouping.
