Microsoft Excel Spreadsheet
XLS is Microsoft Excel's legacy binary spreadsheet format (Excel 97-2003), built on the OLE2 Compound File Binary Format. It stores worksheets, formulas, charts, pivot tables, and VBA macros in BIFF8 records within a CFBF container, superseded by the XML-based XLSX in Office 2007.
Binary Excel format requires Microsoft's proprietary calculation and rendering engine not available in browser WASM.
أسئلة شائعة
What is the difference between XLS and XLSX?
XLS is a proprietary binary format (OLE2/BIFF8) used by Excel 97-2003 with a 65,536-row limit. XLSX is a ZIP archive of XML files introduced in Office 2007 with support for over 1 million rows. XLSX produces smaller files and is the current default for all modern Excel versions.
Is it safe to open XLS files from unknown sources?
No. XLS files can contain VBA macros that auto-execute malware, OLE embedded objects, and DDE fields that run system commands. Always open untrusted XLS files in Protected View or convert to PDF/XLSX first via LibreOffice headless.
How do I convert XLS to XLSX without Microsoft Office?
Use LibreOffice from the command line: libreoffice --headless --convert-to xlsx input.xls. This works on Windows, macOS, and Linux without a GUI. Google Sheets also converts XLS to its format on upload, then you can download as XLSX.
Can I open XLS files that use 65,536+ rows?
XLS cannot store more than 65,536 rows — that is a hard limit of the BIFF8 format. If you need more rows, convert to XLSX which supports 1,048,576 rows and 16,384 columns.
ما يميز .XLS
What is an XLS file?
XLS is the binary spreadsheet format used by Microsoft Excel from 1997 to 2003. It stores data in worksheets with cells organized in rows and columns, supporting formulas, charts, pivot tables, and macros. It was replaced by the XML-based XLSX format in Excel 2007.
اكتشف التفاصيل التقنية
How to open XLS files
- Microsoft Excel (Windows, macOS, Web) — Full support
- Google Sheets (Web) — Free, online editing
- LibreOffice Calc (Windows, macOS, Linux) — Free
- Apple Numbers (macOS, iOS) — Free
- WPS Spreadsheets (Windows, macOS) — Free
Technical specifications
| Property | Value |
|---|---|
| Format | BIFF (Binary Interchange File Format) |
| Max Rows | 65,536 |
| Max Columns | 256 (IV) |
| Max Sheets | Limited by memory |
| Macros | VBA macro support |
| Charts | Embedded chart objects |
Programs that open XLS files
- Microsoft Excel — Native spreadsheet editor
- Google Sheets — Free online alternative
- LibreOffice Calc — Free desktop alternative
- WPS Spreadsheets — Free office suite
- Apache OpenOffice Calc — Open-source option
Common use cases
- Legacy spreadsheets: Old Excel files from pre-2007
- Financial data: Budgets, accounting, financial models
- Data analysis: Statistical analysis and reporting
- Compatibility: Sharing with legacy systems
المرجع التقني
- نوع MIME
application/vnd.ms-excel- Magic Bytes
D0 CF 11 E0 A1 B1 1A E1OLE2 header, same as DOC/PPT.- المطوّر
- Microsoft
- سنة التقديم
- 1987
- معيار مفتوح
- لا
OLE2 header, same as DOC/PPT.
البنية الثنائية
XLS files use the OLE2 Compound File Binary Format (CFBF), the same container used by DOC and PPT. The file opens with the 512-byte CFBF header containing the magic signature D0 CF 11 E0 A1 B1 1A E1, sector size (512 or 4096 bytes), FAT/DIFAT chain locations, and the first directory sector pointer. Inside the CFBF container, the primary stream is 'Workbook' (Excel 97+) or 'Book' (Excel 5/95), containing sequential BIFF8 records. Each BIFF8 record starts with a 4-byte header: 2-byte record type identifier followed by 2-byte data length. Key record types include BOF (0x0809, beginning of file/substream), SHEET (0x0085, sheet name and position), ROW (0x0208), LABELSST (0x00FD, string cell referencing the SST), NUMBER (0x0203, IEEE 754 float cell), FORMULA (0x0006, formula bytecode plus cached result), SST (0x00FC, Shared String Table for deduplication), and EOF (0x000A). The Shared String Table stores every unique string in the workbook once, with cell records referencing SST indices — this is the primary size optimization in BIFF8. VBA macros live in a separate 'VBA' storage within the CFBF directory structure.
| Offset | Length | Field | Example | Description |
|---|---|---|---|---|
0x00 | 8 bytes | CFBF Signature | D0 CF 11 E0 A1 B1 1A E1 | OLE2 magic bytes. Identifies CFBF container. Shared by DOC, XLS, PPT, and MSG files. |
0x08 | 16 bytes | CLSID | 00 00 00 00 ... (16x 00) | Class identifier. Typically all zeros for XLS files. |
0x18 | 2 bytes | Minor version | 3E 00 | Minor version of the CFBF specification. |
0x1A | 2 bytes | Major version | 03 00 | 3 = CFBF v3 (512-byte sectors). 4 = CFBF v4 (4096-byte sectors). |
0x1C | 2 bytes | Byte order | FE FF | Always FE FF (little-endian). CFBF does not support big-endian. |
0x1E | 2 bytes | Sector size power | 09 00 | Sector size as power of 2. 9 = 512 bytes (v3). 12 = 4096 bytes (v4). |
0x30 | 4 bytes | First directory sector | 00 00 00 00 | Location of the first directory sector containing stream and storage entries. |
نقاط الضعف
- VBA macros — XLS files can contain auto-executing macros that download and run malware (macro viruses are the top Office attack vector)
- OLE2 embedded objects — ActiveX controls and OLE objects inside XLS can execute code on open
- DDE (Dynamic Data Exchange) fields can launch arbitrary commands when the spreadsheet is opened, even without macros enabled
- Formula injection — crafted cell values starting with = can trigger unintended command execution when exported to CSV and reopened
الحماية: FileDex does not open or parse XLS files in the browser. XLS is a reference-only page. Users should open untrusted XLS files in Protected View (Microsoft Excel) or convert to PDF/XLSX via LibreOffice headless before viewing.