What Is a XLS File? Structure, Uses and Limits

November 08, 2026 · XLS.now Editorial · XLS Essentials

Understand what XLS stores, how to identify it and when it is the right format.

The Binary Foundation of Early Spreadsheets

An XLS file is a binary spreadsheet format developed by Microsoft for Excel, predating the XML-based XLSX format. Unlike modern Office Open XML formats, XLS stores data in a proprietary binary structure called the OLE2 (Object Linking and Embedding) compound document container. This container functions as a mini file system within a single file, organizing workbook data, formatting, macros, and metadata into streams and storages.

According to Microsoft's Open Specification for the XLS format, the file is divided into a BIFF (Binary Interchange File Format) record structure, where each record type has a fixed header and variable-length data payload. The primary reference (https://learn.microsoft.com/en-us/openspecs/officefileformats/ms-xls/) defines over 500 record types, including BOF (Begin of File), EOF (End of File), SST (Shared String Table), and DIMENSIONS (used cell range). This binary layout means XLS files are not human-readable and require specific parsers to interpret correctly.

The OLE2 Container: How Data Is Organized

Streams and Storages

Inside the OLE2 container, XLS data resides in streams named Workbook or Book (the primary BIFF stream), with optional substorages for macros (Macros), charts, or embedded objects. The container uses a sector-based allocation system, typically with 512-byte sectors, which limits the file to a theoretical maximum of 4 GB. Practical limits are far lower due to memory constraints in older Excel versions.

BIFF Record Chain

The workbook stream consists of a sequence of BIFF records. Key records include:

  • BOF (record type 0x0809): Marks the beginning of a workbook, worksheet, or chart.
  • SST (0x00FC): Stores all unique text strings used in the workbook, enabling efficient string deduplication.
  • DIMENSIONS (0x0200): Specifies the used cell range (first row, last row, first column, last column).
  • LABEL (0x0204): Stores a single text cell value, referencing the SST.
  • NUMBER (0x0203): Stores a numeric cell value as an IEEE 754 double-precision floating-point number.
  • FORMULA (0x0006): Stores a formula token stream, not the computed result.

The specification notes that record order is critical: parsers expect a BOF at the start, followed by global workbook settings, then worksheet records, and finally an EOF. Corruption often results from broken record ordering or truncated SST entries.

Observable Validation Checks for what is xls complete format guide

File Signature Verification

The first 8 bytes of an XLS file are D0 CF 11 E0 A1 B1 1A E1 (the OLE2 magic number). This signature is shared with other Microsoft Office binary formats (DOC, PPT), so further inspection is required. The BIFF version is stored in the BOF record at offset 0x0004 from the start of the workbook stream:

  • BIFF5 (Excel 5/95): 0x0500
  • BIFF7 (Excel 97): 0x0700
  • BIFF8 (Excel 97-2003): 0x0600

Structural Integrity Checks

XLS files always contain at least one BOF record (book-level) and one EOF record. Missing or duplicate BOF records indicate corruption. The SST record, if present, must appear before any cell data records. The DIMENSIONS record defines the sheet boundaries; any cell data outside these bounds is ignored by strict parsers.

MIME Type Registration

The registered MIME type is application/vnd.ms-excel. Some systems also use application/msexcel or application/x-msexcel. For web servers, always serve with Content-Type: application/vnd.ms-excel to avoid browser misinterpretation.

Hard Limits and Constraints

Sheet and Cell Limits

XLS supports a maximum of 256 columns (column IV) and 65,536 rows per worksheet. This contrasts with XLSX's 16,384 columns and 1,048,576 rows.

String Storage Limits

The Shared String Table is limited to 65,535 unique strings. Practical limits are lower due to memory constraints in 32-bit Excel versions.

Formatting Constraints

XLS cannot store conditional formatting rules with more than three conditions. Color support is limited to a 56-color palette, stored in the PALETTE record (0x0092).

File Size Ceiling

While the OLE2 container supports up to 4 GB, Excel 2003 and earlier crash at approximately 2 GB due to 32-bit memory limitations.

Encoding Limitations

Pre-Excel 2000 XLS files use ASCII encoding. Unicode support was added in BIFF version 8 (Excel 97).

Corruption Fragility

A single corrupted BIFF record can make the entire file unreadable, unlike XLSX where ZIP compression allows partial recovery of intact XML parts.

When XLS Fits and When It Fails

Appropriate Use Cases

  • Legacy compatibility: XLS works with Excel 97-2003 and many older spreadsheet applications (Lotus 1-2-3, OpenOffice 3.x).
  • Macro support: VBA macros are stored natively in the OLE2 container, unlike XLSX which requires a separate macro-enabled format (XLSM).
  • Small file size: For simple spreadsheets with limited text, XLS binary encoding often produces smaller files than XML-based XLSX.

Decision Table: XLS vs. XLSX

Criterion Choose XLS Choose XLSX
Data volume < 65,536 rows, < 256 columns Larger datasets
Macro dependency VBA macros required Macros not needed or use XLSM
Target software Excel 97-2003 or legacy apps Excel 2007+ or cloud tools
File size optimization Simple tables with few strings Complex formatting or many strings
Cross-platform safety Windows only (due to OLE2) All platforms (ZIP + XML)
Future-proofing Short-term archival only Long-term storage and interoperability

Unrecoverable Failure Scenarios

Some XLS problems have no fix:

  • OLE2 container corruption: If the sector allocation table (SAT) is damaged, no data can be extracted, even with hex editors.
  • Missing SST: Without the Shared String Table, all text cells become unreadable placeholders.
  • BIFF version mismatch: A BIFF8 parser cannot read BIFF5 files, and vice versa, without explicit compatibility code.
  • Truncated files: If the file ends before the final EOF record, the entire workbook is considered invalid by strict parsers.

The XLS format is a historical artifact with specific, narrow use cases. For new work, XLSX or CSV is almost always the safer choice. For legacy data, understanding the OLE2 container and BIFF record structure is essential before attempting any migration or repair.