Introduction
BIFF8 is the workbook format of Excel 97, 2000, 2002 and 2003, and of nearly every
.xls file in use. Excel 2007 and later still open and save it as “Excel
97–2003 Workbook”, and many programs still export to it because almost everything can
read it. Compared with BIFF5 it added
Unicode text and a shared string table.
Microsoft publishes the format in full as [MS-XLS], one of its Office open specifications.
Structure
The file is a compound file, which starts with the signature
D0 CF 11 E0 A1 B1 1A E1, holding a stream named Workbook.
The stream is a sequence of records, each a 2-byte type, a 2-byte length and up to
8,224 bytes of data, all little-endian; longer data carries on in CONTINUE records. The
workbook globals come first: a BOF record (type 0x0809, version
0x0600), fonts, number formats, cell formats, one BOUNDSHEET record per
sheet with the offset of its records, and the SST record, the shared string table.
Each sheet then follows as its own BOF to EOF block. Text cells are LABELSST records
that point into the shared string table; numbers use NUMBER or the compact RK records.
0BOF workbook globals begin, version0x0600record…FONT, FORMAT, XF fonts and cell formatsrecords…BOUNDSHEET one per sheet: name and offsetrecords…SST the shared strings, then EOFrecords…BOF … EOF one block per sheet: rows and cellsrecords
Links
Software
- Microsoft Excel (Windows, macOS, web, mobile)
- LibreOffice Calc (Windows, macOS, Linux)
- Google Sheets (web browsers)
- Apple Numbers (macOS, iOS)
Developers
- xlrd, Python library that reads
.xlsfiles - Apache POI, Java library for Office files,
.xlsthrough its HSSF classes - SheetJS, JavaScript library that reads and writes spreadsheets