XLSB File Documentation
Summary
An .xlsb file is a Microsoft Excel Binary Workbook, an Excel spreadsheet saved in Excel's binary format instead of the usual XML-based XLSX. It is still a ZIP/OPC package, but the sheets are stored as binary BIFF12 records, so it opens, saves, and recalculates faster and is smaller for very large models. Its MIME type is application/vnd.ms-excel.sheet.binary.macroEnabled.12. Excel opens it natively; LibreOffice Calc, Google Sheets, and WPS read it too. The simplest compatibility fix is to open it once and Save As .xlsx.
Technical details
| Feature | Value |
|---|---|
| Full name | Microsoft Excel Binary Workbook |
| File extension | .xlsb |
| MIME type | application/vnd.ms-excel.sheet.binary.macroEnabled.12 |
| Format type | ZIP-based OPC package with binary (BIFF12) cell records |
| Developer | Microsoft |
| Introduced | 2007 (Excel 2007) |
| Code name | BIFF12 |
| Category | Spreadsheet |
| Container / base format | ZIP / Open Packaging Conventions (OPC) |
| Sheet storage | Binary .bin parts (not XML) |
| Magic number | 50 4B 03 04 (“PK”, ZIP local file header) |
| Byte order | Little-endian within records |
| Macro-capable | Yes — can embed xl/vbaProject.bin (VBA) |
| Row / column limit | 1,048,576 rows × 16,384 columns |
| Open standard | Partial — documented as [MS-XLSB] |
| Opens in | Excel, LibreOffice Calc, Google Sheets, WPS Office |
| Convert to | .xlsx, .xlsm, .csv, .ods, .pdf |
| Related extensions | .xlsx, .xlsm, .xls, .csv, .ods |
| Specification | learn.microsoft.com/openspecs/office_file_formats/ms-xlsb/ |
What is an XLSB file?
XLSB is short for Excel Binary Workbook, an alternative save format Microsoft introduced with Excel 2007 alongside the XML-based XLSX and XLSM. All three share the same outer container: a ZIP archive following the Open Packaging Conventions (OPC). What differs is what goes inside. XLSX stores each worksheet as a human-readable XML document; XLSB stores it as a stream of binary records, the format Microsoft code-named BIFF12. Microsoft documents the layout publicly as [MS-XLSB].
The format exists for one reason: speed. Because Excel can read and write the binary records directly without parsing XML, very large workbooks open, save, and recalculate noticeably faster, and the files are usually smaller on disk. Finance and data teams deliberately save huge models, hundreds of thousands of rows across many sheets with heavy formulas, as XLSB for exactly this reason. Functionally it is equivalent to XLSX and XLSM: the same cells, formulas, charts, pivot tables, and formatting, and like XLSM it can carry VBA macros.
The OPC package: what is inside the ZIP
Rename an .xlsb to .zip and open it, and you find the familiar OPC layout, with binary parts where XLSX would have XML. Every part is a separate compressed member of the ZIP, and a [Content_Types].xml file at the root declares each part's content type so Excel knows which are binary.
workbook.xlsb (ZIP / OPC package)
├─ [Content_Types].xml declares part content types (XML)
├─ _rels/.rels package relationships
├─ xl/workbook.bin sheet list, named ranges (BIFF12)
├─ xl/worksheets/sheet1.bin cell data + formulas (BIFF12)
├─ xl/sharedStrings.bin de-duplicated text table (BIFF12)
├─ xl/styles.bin number formats, fonts, fills (BIFF12)
└─ xl/vbaProject.bin VBA macros, if present
The tell-tale difference from XLSX is the file extension of the parts: sheet1.bin rather than sheet1.xml, sharedStrings.bin rather than sharedStrings.xml. The relationships and content-type maps stay as XML, so the package plumbing is identical; only the bulk data, the cells and strings and styles, switches to binary. That is why the ZIP still starts with the same PK signature as any other OPC file.
The BIFF12 record stream
Each .bin part is a sequence of BIFF12 records. A record is a self-describing chunk: a numeric record type, a length, and then that many bytes of payload. A reader loops over the stream reading one record after another, dispatching on the type, and can skip a record it does not recognise by advancing past its declared length. This is the same record philosophy as the old XLS BIFF8 format, mapped onto the modern OPC container.
BIFF12 record framing:
record type variable-width integer (1 or 2 bytes)
record size variable-width integer (1 to 4 bytes), payload length
payload <record size> bytes of little-endian fields
Both the type and the size are stored as variable-width integers to keep common records compact: a type below 128 fits in a single byte, and short payloads encode their length in one byte rather than four. Records come in matched pairs that bracket structures, a “begin” record and an “end” record around, say, a worksheet's dimension or a table definition, mirroring how XML uses opening and closing tags. Numeric cell values, formula tokens, and style indices are all little-endian binary fields, which is what removes the XML parsing cost that XLSX pays.
Why the binary records are faster and smaller
The performance gap between XLSB and XLSX comes down to representation. In XLSX, the number 1234.5 in a cell is stored as the text <c r="A1"><v>1234.5</v></c>: Excel must parse that XML, convert the digit string back to a double, and reverse the process on save. In XLSB the same value is an 8-byte IEEE 754 double written straight into a cell record, read and written with no text conversion at all. Multiply that across millions of cells and the saving is large, in both time and file size.
Shared strings work the same way. Repeated text is stored once in sharedStrings.bin and referenced by an integer index, so a column of the same category label costs a few bytes per cell rather than a repeated XML string. The trade-off is inspectability: an XLSX can be diffed, patched, or generated by any tool that writes XML, while an XLSB requires a library that understands the binary records. Far fewer third-party tools and programming libraries read XLSB than read XLSX, which is the main practical downside.
Opening XLSB without Excel, and converting it
Microsoft Excel opens XLSB natively with full fidelity. Without Excel, the free LibreOffice Calc reads and writes XLSB directly, and both Google Sheets (upload to Drive) and WPS Office open it too. Apple Numbers cannot open XLSB, so on a Mac without Excel you convert first in LibreOffice.
The standard compatibility fix is to open the file once and Save As XLSX, the XML format nearly every spreadsheet tool and library reads. One caveat matters: if the workbook contains macros, save as .xlsm instead, because plain .xlsx silently drops the VBA project. For pure data extraction, Save As CSV gives a single-sheet, formula-free table; for an open-standard editable copy, ODS. Exporting to the old “XML Spreadsheet 2003” SpreadsheetML is not worth doing, since the modern XLSX is already XML inside a ZIP.
XLSB and macros: a real security caveat
Many guides treat XLSB as being as inert as XLSX. It is not. XLSB is a macro-capable format: it can embed an xl/vbaProject.bin part holding a VBA macro project, exactly like an XLSM. That places it in the same threat category as macro-enabled workbooks, not the same category as plain XLSX.
The attack path is the VBA engine. A malicious workbook can carry an Auto_Open or Workbook_Open macro that runs the moment the file is opened and macros are enabled, and macro-bearing spreadsheets are a well-worn phishing vector for delivering malware. Excel's defences are Protected View, which opens files from the internet or email in a sandboxed read-only mode, and the macro-disabled-by-default prompt. The safe practice is to leave Protected View on and never enable macros for a file you were not expecting. If you only need to read the numbers, opening the XLSB in Google Sheets or LibreOffice bypasses Excel's VBA engine entirely, since neither runs the embedded VBA.
References
- Microsoft — [MS-XLSB]: Excel (.xlsb) Binary File Format
- Microsoft Support — File formats supported in Excel
- The Document Foundation — LibreOffice Calc
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.