File types · Explainer

The XLSB file (.xlsb)

An XLSB file is an Excel Binary Workbook: the same ZIP package as an XLSX, but with sheets stored as compact binary records instead of XML. This guide explains what's inside one, why it exists, how it compares with XLSX and CSV, which programs open it, and has free sample XLSB files to download for testing.

At a glance

Full name
Excel Binary Workbook (BIFF12)
Extensions
.xlsb
MIME type
application/vnd.ms-excel.sheet.binary.macroEnabled.12
Kind
Binary: a ZIP package (like XLSX) whose main parts are BIFF12 records
Owner
Microsoft; documented in the [MS-XLSB] open specification, not an international standard
First released
2006, with Office 2007 (Excel 2007), as a save option next to XLSX
Opens with
Excel, Excel for the web; LibreOffice Calc can open but not save it
Magic number
50 4B 03 04 ("PK"), the ZIP signature; the package points to xl/workbook.bin
Sheet size
1,048,576 rows by 16,384 columns, as in XLSX
Macros
Allowed: VBA and Excel 4.0 macro sheets, with no separate extension
Records
1 to 2 bytes of type, 1 to 4 bytes of length, then the data

The basics

What is an XLSB file?

XLSB is Excel's binary workbook format, listed in the Save As menu as "Excel Binary Workbook". It holds everything an XLSX holds, sheets, formulas, formatting, charts, tables, pivot tables, and also macros. Microsoft introduced it with Excel 2007 as a faster alternative to the XML formats, for people who load and save large workbooks.

Most people meet XLSB in two places: big workbooks that someone saved in the binary format to make them smaller and faster, and Personal.xlsb, the Personal Macro Workbook. Excel stores macros you record "in the Personal Macro Workbook" in that file, in the XLStart folder, and opens it whenever Excel starts.

Three things an XLSB file is not:

  • Not the old XLS. XLS is the binary format of Excel 97 to 2003, inside an OLE2 compound file and limited to 65,536 rows. XLSB uses the newer ZIP packaging and the full 1,048,576-row grid.
  • Not an open standard. XLSX is ECMA-376 and ISO/IEC 29500. XLSB is documented by Microsoft in the [MS-XLSB] specification but not standardised, and few programs other than Excel write it.
  • Not macro-free. Unlike .xlsx, the extension says nothing about macros: an .xlsb file may or may not contain them.

Anatomy

What's inside an XLSB file

Unzip an XLSB file and you see the same layout as an XLSX: content types, relationships, a workbook, sheets, styles and shared strings. The difference is inside the parts. Where XLSX has sheet1.xml, XLSB has sheet1.bin, a list of binary records. This is our sample-minimal.xlsb, its parts and the records of its only sheet.

sample-minimal.xlsb (parts and records)
sample-minimal.xlsb  (a ZIP package, 2,093 bytes)
offset 0: 50 4B 03 04 …  "PK", a ZIP local file header

[Content_Types].xml          XML: the type of every part
_rels/.rels                  XML: points to xl/workbook.bin
xl/workbook.bin              records: sheet list, calculation settings
xl/_rels/workbook.bin.rels   XML: links to the sheet, styles, strings
xl/worksheets/sheet1.bin     records: the cells
xl/styles.bin                records: fonts, number formats, cell formats
xl/sharedStrings.bin         records: each distinct text, stored once

xl/worksheets/sheet1.bin, record by record
offset  header    type  record             data
0000    81 01 00   129  BrtBeginSheet      (none)
0003    94 01 10   148  BrtWsDim           16 bytes: rows 0-5, columns 0-1
0016    85 01 00   133  BrtBeginWsViews    … the sheet view …
0040    91 01 00   145  BrtBeginSheetData  (none)
0043    00 19        0  BrtRowHdr          row 0, height 300 twips, cells in A:B
005e    07 0c        7  BrtCellIsst        column 0, string 0 ("Item")
006c    07 0c        7  BrtCellIsst        column 1, string 1 ("Price")
007a    00 19        0  BrtRowHdr          row 1
0095    07 0c        7  BrtCellIsst        column 0, string 2 ("Mug")
00a3    05 10        5  BrtCellReal        column 1, 00 00 00 00 00 00 29 40 = 12.5
00b5    00 19        0  BrtRowHdr          row 2: "Notebook", 9.75
00f0    00 19        0  BrtRowHdr          row 3
010b    07 0c        7  BrtCellIsst        column 0, string 4 ("Total")
0119    09 2b        9  BrtFmlaNum         column 1, cached result 22.25, then
                          17 bytes of tokens:
                          25 01000000 02000000 01c0 01c0  PtgArea B2:B3
                          42 01 0400                      PtgFuncVar SUM, 1 argument
0146    00 19        0  BrtRowHdr          row 5: the 99helpers note
016f    92 01 00   146  BrtEndSheetData    (none)
0172    82 01 00   130  BrtEndSheet        (none)
  1. 150 4B 03 04

    The ZIP signature

    An XLSB starts like any ZIP file, and like every XLSX, DOCX and PPTX. There's no XLSB-specific magic number: a reader has to look inside, where _rels/.rels points to xl/workbook.bin instead of xl/workbook.xml.

  2. 2[Content_Types].xml

    The XML that remains

    Content types and relationships stay XML, exactly as in XLSX. Only the workbook content moves into .bin parts. The workbook part's content type is application/vnd.ms-excel.sheet.binary.macroEnabled.main.

  3. 381 01 00

    A record header

    The first byte has its high bit set, so the record type continues in the next byte: 1 from 0x81 plus 1 × 128 from 0x01 gives type 129, BrtBeginSheet. The next byte, 00, is the data length: none. Lengths use the same 7-bits-per-byte scheme, up to 4 bytes.

  4. 494 01 10 · BrtWsDim

    The used range

    Type 148, 16 bytes of data: first row, last row, first column, last column, 4 bytes each. Here rows 0 to 5 and columns 0 to 1, so A1:B6.

  5. 500 19 · BrtRowHdr

    A row header

    Type 0 fits in one byte: the specification reserves one-byte types for the most common records. Each row with content starts with one, giving the row number, its height and which columns hold cells. The cells that follow don't repeat the row number.

  6. 607 0c · BrtCellIsst

    A text cell

    Column (4 bytes), cell format (3 bytes plus a flag byte) and an index into sharedStrings.bin. String 2 is Mug. As in XLSX, each distinct text is stored once.

  7. 705 10 · BrtCellReal

    A number cell

    The value is an 8-byte IEEE 754 double, 00 00 00 00 00 00 29 40, which is 12.5. XLSX would store the text 12.5 and every reader would have to parse it; here it's copied straight into memory.

  8. 809 2b · BrtFmlaNum

    A formula and its result

    The cached result (22.25) comes first, then the formula as parsed tokens in reverse Polish order, not as text. A reader that only wants values skips the tokens.

  9. 925 … 42 01 04 00

    The formula tokens

    PtgArea pushes the range B2:B3 (rows as 4-byte numbers, columns with relative-reference flags 0xC000), then PtgFuncVar calls function number 4, SUM, with one argument. It's the same token scheme as XLS, widened for the bigger grid.

  10. 1092 01 00 · 82 01 00

    End records

    Every Begin record has a matching End record, so a reader can skip whole blocks it doesn't understand.

Under the hood

How an XLSB file is put together

An XLSB uses the Open Packaging Conventions, the same ZIP-plus-relationships packaging as XLSX, DOCX and PPTX. The parts that carry the workbook's content, workbook.bin, each sheetN.bin, styles.bin and sharedStrings.bin, hold BIFF12 records instead of XML. Microsoft called the format BIFF12, the binary file format of Office 12, which was Office 2007's internal version number.

  • Records, not tags. Each record is a type, a length and data. Types under 128 take one byte and are reserved for the most common records, such as rows and cells. Others take two. Lengths take one to four bytes.
  • Begin and End pairs. Structures are bracketed by records such as BrtBeginSheetData and BrtEndSheetData, so a reader can find the cells without understanding everything before them.
  • Numbers stay binary. A number cell holds an 8-byte double (or, for many whole numbers, a compact 4-byte RK value), not decimal text that has to be parsed.
  • Formulas are pre-parsed. Like XLS, XLSB stores formulas as tokens in reverse Polish order, with the last result. Excel doesn't need to parse formula text on load, which is part of why it's fast.
  • Much else works as in XLSX: the grid size, the 1900 and 1904 date systems, shared strings and cell formats referred to by index.

Look inside one yourself

Run unzip -l file.xlsb to see the parts. The .bin parts are binary, so open one in a hex viewer, or decode it with a short script: read a byte, and if its high bit is set, read another for the type; then read the length the same way, and skip that many bytes to the next record.

Speed and size

Why XLSB exists: smaller files, faster loading

XML is easy to read and to generate, but it's slow for big workbooks: every cell is wrapped in tags, every number is text, and every formula has to be parsed. XLSB was made for people who need to load and save large files as fast as possible. The Library of Congress format description sums up the result: compared with XLSX, XLSB files are usually smaller and usually load faster.

One data point, not a benchmark: our sample-1mb.xlsb (52,140 order rows, a formula on every row) and the XLSX that LibreOffice 24.2 saves from it. Other XLSX writers produce smaller or larger files.
XLSB (our sample)XLSX (LibreOffice)
File size1,048,576 bytes2,347,546 bytes
Worksheet part before compression8,238,332 bytes of records22,642,055 bytes of XML
Worksheet part compressed916,470 bytes2,208,895 bytes

The gain is largest for big sheets of numbers and formulas. For a small workbook the difference is a few kilobytes and doesn't matter. Microsoft hasn't published figures we could cite, so treat any percentage you see quoted as one person's measurement.

Comparison

XLSB vs XLSX, XLSM, XLS and CSV

XLSBXLSXXLSMXLSCSV
StructureZIP of binary recordsZIP of XMLZIP of XMLBIFF8 records in an OLE2 filePlain text
Rows per sheet1,048,5761,048,5761,048,57665,536No limit in the format
MacrosYesNoYesYesNo
Formulas stored asParsed tokensTextTextParsed tokensValues only
Open standardDocumented, not a standardYes (ISO/IEC 29500)Yes (ISO/IEC 29500)Documented, not a standardRFC 4180 (informational)
Outside MicrosoftRead by some programs and librariesRead and written almost everywhereWidely read; macros only run in ExcelRead almost everywhereEverywhere
  • Use XLSB for large workbooks that stay inside Excel, such as models and reports that take long to open or save, and for Excel's own Personal.xlsb.
  • Use XLSX when the file will be shared, opened in Google Sheets, Numbers or LibreOffice, or read by code. It's the safe default.
  • Use XLSM when a workbook needs macros and other people should see that from the file name.
  • Use CSV to move one table of data between programs.

Compatibility

Which programs open XLSB files?

ProgramXLSB support
Excel for WindowsOpens and saves it (File, Save As, Excel Binary Workbook).
Excel for the webListed by Microsoft among the supported formats.
LibreOffice CalcOpens it. It can't save XLSB: soffice --convert-to xlsb fails with "no export filter". Save as XLSX or ODS instead.
Google Sheets.xlsb isn't in Google's list of importable files. Convert it to XLSX first.
Apple NumbersApple only says Numbers imports "Excel spreadsheets". If an XLSB won't open, save it as XLSX in Excel first.
Pythonpandas reads it with the pyxlsb or calamine engine (read_excel docs). openpyxl refuses it: "openpyxl does not support binary format .xlsb".
JavaScriptSheetJS reads it, formulas included. Version 0.18.5 also writes XLSB, but in our test it wrote the values without the formulas.

Reading an XLSB is well supported in code; writing one isn't. Apart from Excel, few tools save XLSB, and the Library of Congress lists mainly commercial libraries. If a system has to produce Excel files, have it write XLSX.

Troubleshooting

Common XLSB problems and how to fix them

  • Google Sheets or another app won't open it. Most tools outside Microsoft's own don't import XLSB. Open it in Excel, Excel for the web or LibreOffice and save a copy as XLSX.
  • "The file format or file extension is not valid." The file was renamed between .xlsx and .xlsb. The packaging is the same, but the parts inside are not; rename it back. A file is XLSB if unzip -l lists xl/workbook.bin.
  • Dates come out as numbers like 46296 when read with code. pyxlsb and calamine return the serial number for XLSB date cells. Convert it, for example with pyxlsb.convert_date(46296), which gives 1 October 2026.
  • Your antivirus or mail filter blocks it. XLSB files can carry macros and are binary, so some filters quarantine them. Send XLSX when the workbook has no macros.
  • The macros don't run. The file came from the internet and Office blocked its macros, or you opened it in Excel for the web, LibreOffice or a library, which don't run VBA. Only enable macros in files you trust.
  • It's still big. XLSB shrinks cells and formulas, not images, pivot caches or formatting applied to millions of empty cells. Clear unused formatting and remove old pivot caches.

How to

How to open, edit and convert an XLSB file

  • On Windows: double-click it to open it in Excel. To change formats, File, Save As, and pick Excel Workbook (.xlsx) or Excel Binary Workbook (.xlsb).
  • Without Excel: upload it to OneDrive and open it in Excel for the web (free with a Microsoft account), or open it in LibreOffice Calc on Windows, macOS or Linux and save it as XLSX or ODS.
  • In a browser: browsers can't display XLSB files, so a link to one downloads it.
  • To XLSX on a server: soffice --headless --convert-to xlsx file.xlsb, with LibreOffice installed.
  • To CSV: in Excel, File, Save As, CSV; only the active sheet is saved. In Python: pandas.read_excel("file.xlsb", engine="pyxlsb").to_csv("file.csv").
  • Read it in code: pyxlsb or python-calamine in Python, SheetJS in JavaScript, calamine in Rust. Most return the stored values and ignore the formulas.

Security

Is an XLSB file safe to open?

Treat an XLSB like an XLSM or an old XLS: it may contain macros, and nothing in the name tells you. Two kinds are possible:

  • VBA macros in xl/vbaProject.bin, which run after you click Enable Content, as in any macro-enabled Excel file.
  • Excel 4.0 (XLM) macro sheets in xl/macrosheets/. Malware analysts have documented XLSB attachments hiding XLM formulas in xl/macrosheets/sheet1.bin; when first checked, only one antivirus engine detected the sample. Binary records are harder for scanners and people to inspect than XML.

To check a file without opening it in Excel, list its parts with unzip -l. If there's no vbaProject.bin and no macrosheets folder, the file has no VBA or Excel 4.0 macros. External links, data connections, hidden sheets and author names in docProps/core.xml can be present as in any Excel file.

Don't enable content in an XLSB you didn't expect. If your server accepts uploaded spreadsheets, consider whether you need XLSB at all; if you do, parse it with a maintained library, limit file and decompressed size, and never execute anything in it.

Free downloads

Sample XLSB files to download

Free sample Excel Binary Workbooks for testing uploads, converters and spreadsheet libraries. No open-source spreadsheet program saves XLSB with formulas, so we wrote these record by record from Microsoft's [MS-XLSB] specification with a small Python script. Each one was read back with pyxlsb, python-calamine and SheetJS, and opened and converted to XLSX by LibreOffice; all four agree on every value and formula. None contains macros. We couldn't open them in Excel itself.

sample-workbook.xlsb · 4.7 KBDownload

Browsers can't show this kind of file in a page. Download it to open it in the app it belongs to.

What's inside sample-workbook.xlsb

Browsers can't preview XLSB files, so download it and open it in Excel, Excel for the web or LibreOffice. It holds the same orders as our sample XLSX and sample XLS workbooks, so you can compare the formats.

  1. Orders sheet

    Twelve fictional orders, with a bold header row and set column widths (BrtColInfo records).

  2. Order IDs as text

    000184 and the rest are text cells pointing into sharedStrings.bin, so their leading zeros survive.

  3. Dates and currency

    Dates are serial numbers stored as compact RK values with a yyyy-mm-dd number format; prices are 8-byte doubles with a euro format. The first date is 46296.

  4. Formulas with cached results

    Each line total is =E2*F2 (two PtgRef tokens and PtgMul), and the totals row uses SUM. Every formula carries its result, so readers that don't calculate still show 25 in G2 and 255.07 in G14.

  5. About sheet

    A short description of the file and how it was made, and the date it was created.

  6. Document properties

    Title, author and description in docProps/core.xml, which stays XML in an XLSB.

All sample XLSB files

  • Sample workbook

    sample-workbook.xlsb · 4.7 KB (4,862 bytes)

    Two sheets: twelve orders with text IDs, dates, euro prices, =E2*F2 line totals and SUM totals, all formulas stored with their results; and an About sheet. Fictional data.

    • Testing spreadsheet libraries and converters
    • Comparing XLSB with XLSX and XLS
  • Minimal XLSB

    sample-minimal.xlsb · 2.0 KB (2,093 bytes)

    Seven parts and one sheet: two items, their prices and a SUM formula, plus a note. No document properties or theme. It's the file in the anatomy above.

    • Learning the BIFF12 record structure
    • Smoke tests for XLSB readers
  • 1 MB XLSB file

    sample-1mb.xlsb · 1 MB (1,048,576 bytes)

    52,140 rows of fictional orders, each with an =E*F formula and its result, padded to exactly 1,048,576 bytes (1 MiB) with a filler text in the document properties.

    • Upload and size-limit tests
    • Import performance, and size comparisons with XLSX

Ways to test with them

  • Formula results: a reader should report 25 in Orders!G2 of sample-workbook.xlsb and 255.07 in G14 without recalculating. Libraries that decode formulas, such as SheetJS, should give E2*F2 and SUM(G2:G13).
  • Dates: Orders!B2 holds 46296 with a date format. pyxlsb and calamine return the number; your code should turn it into 1 October 2026.
  • Format detection: an upload check that only looks at the first bytes will call these files ZIP archives. Look for xl/workbook.bin inside to recognise XLSB.
  • Converters: soffice --headless --convert-to xlsx sample-workbook.xlsb should give an XLSX with the same 14 formulas and values.
  • Upload limits: sample-1mb.xlsb is exactly 1,048,576 bytes, so you can test a limit right at the boundary.

Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.

Put it online

Have an XLSB file? Give it a link.

Drop an Excel Binary Workbook on 99helpers and it gets its own web address. Browsers can't display XLSB files, so anyone with the link downloads it and opens it in Excel.

Questions

XLSB files, frequently asked

What is an XLSB file?

An Excel Binary Workbook: the format Excel offers as "Excel Binary Workbook" in Save As. It's a ZIP package like XLSX, but the sheets are stored as binary records instead of XML, which makes large workbooks smaller and faster to open.

Is XLSB better than XLSX?

For large workbooks that only Excel will open, often yes: they're usually smaller and load faster. For anything you share or process with other software, no: XLSX is an open standard and almost every program reads and writes it.

Can an XLSB file contain macros?

Yes. XLSB can hold VBA macros and Excel 4.0 macro sheets under the same extension, unlike XLSX, which can't hold macros at all. Excel's Personal Macro Workbook is saved as Personal.xlsb.

How do I open an XLSB file without Excel?

Open it in Excel for the web (free with a Microsoft account) or in LibreOffice Calc, which is free for Windows, macOS and Linux. LibreOffice can't save XLSB, so save your changes as XLSX or ODS.

How do I convert XLSB to XLSX?

In Excel, choose File, Save As, Excel Workbook (.xlsx). Without Excel, open it in LibreOffice and save as XLSX, or run soffice --headless --convert-to xlsx file.xlsb. Any macros are lost in XLSX; save as XLSM to keep them.

Can Google Sheets open XLSB files?

Not directly: .xlsb isn't in the list of file types Google Sheets imports. Convert it to XLSX first, then upload that.

How do I read an XLSB file in Python?

Use pandas with engine="pyxlsb" or engine="calamine", or the pyxlsb and python-calamine libraries directly. openpyxl doesn't support XLSB. Dates come back as serial numbers, which you need to convert.

Why is my XLSB file smaller than the XLSX version?

Each cell is a short binary record instead of XML tags, numbers are 8-byte values instead of text, and formulas are stored as compact tokens. For our 52,140-row sample, the worksheet was 8.2 MB of records against 22.6 MB of XML before compression.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.