.XLS Microsoft Excel Spreadsheet
.xls

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.

بنية الصيغة
Header version
Body content tree
Index references
OLE2 BinaryBIFF8 RecordsVBA MacrosExcel 97-20031997
بواسطة FileDex
غير قابل للتحويل

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 E1 OLE2 header, same as DOC/PPT.
المطوّر
Microsoft
سنة التقديم
1987
معيار مفتوح
لا
00000000D0CF11E0A1B11AE1 ........

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.

OffsetLengthFieldExampleDescription
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.
1987Microsoft Excel 2.0 released for Windows, introducing the earliest XLS binary format1993Excel 5.0 introduces BIFF5 format and VBA macro support1997Excel 97 ships with BIFF8 format in OLE2/CFBF container — the format used through Excel 20032006Microsoft publishes the XLS binary format specification under the Open Specification Promise2007Office 2007 defaults to XLSX (Office Open XML), making XLS a legacy compatibility format
Convert XLS to XLSX via LibreOffice أخرى
libreoffice --headless --convert-to xlsx input.xls

LibreOffice runs in headless mode (no GUI), parsing the OLE2/BIFF8 binary and writing XLSX output. Preserves formulas, formatting, and sheet structure. Output file is created in the current directory.

Convert XLS to PDF via LibreOffice أخرى
libreoffice --headless --convert-to pdf input.xls

Renders the spreadsheet to PDF with page breaks matching Excel's print layout. Useful for archiving financial records and distributing read-only reports.

Extract CSV data from XLS أخرى
libreoffice --headless --convert-to csv input.xls

Extracts the first sheet as comma-separated values. Strips formulas (keeps computed values), formatting, and charts. For multi-sheet extraction, use a macro or ssconvert from Gnumeric.

Batch convert all XLS files to XLSX أخرى
libreoffice --headless --convert-to xlsx *.xls

Converts every XLS file in the current directory to XLSX. Add --outdir /path/to/output to control the destination folder.

XLS XLSX transcode near-lossless XLSX uses ZIP-compressed XML, producing files 40-60% smaller than equivalent XLS. Converting to XLSX removes the 65,536-row and 256-column limits (XLSX supports 1,048,576 rows and 16,384 columns), enables modern Excel features, and allows editing in Google Sheets and web-based spreadsheet tools.
XLS PDF render near-lossless PDF locks the spreadsheet layout for printing and distribution. Converting XLS to PDF eliminates formatting drift across different Excel versions and prevents accidental cell edits when sharing financial reports or invoices.
XLS CSV export lossy CSV extraction strips formatting, formulas, and charts down to raw tabular data. This is the standard ingest format for databases, data science pipelines (pandas, R), and ETL workflows that process spreadsheet content programmatically.
عالي

نقاط الضعف

  • 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.

LibreOffice Calc أداة
Open-source spreadsheet editor with full XLS read/write and headless CLI conversion
Apache POI مكتبة
Java library for reading and writing OLE2 formats including XLS (HSSF) and XLSX (XSSF)
xlrd مكتبة
Python library for reading XLS (BIFF) files. Read-only; does not support XLSX.
Gnumeric أداة
Lightweight spreadsheet with ssconvert CLI for batch XLS to CSV/XLSX conversion
Pandoc أداة
Universal document converter; handles XLS via LibreOffice backend integration