What is a .XLS file?
.XLS is usually a Microsoft Excel workbook that is created by the Microsoft application and is from version 97 through 2003. Under this format, an XLS file has the BIFF8 file enclosed within the OLE Compound File Binary Format. It contains worksheet files, cell data, formulas and numbers, charts, pictures, VBA macro projects or Excel macros, OLE object information and many other items. However, earlier Excel versions have saved their worksheets under extensions .xls too; these work in binary format.
Not all .xls files are Excel spreadsheets since some web applications might use them to refer to any HTML file which can be accessed via the MS Excel program - here we deal with HTML text file. Sometimes, the Excel 2003 XML Spreadsheet Files use an extension called ".xls"; however, these files contain only pure XML with starting tag XML or Office XML not OLE signatures.
A user finds these files in archived documents or reports, emails attachments, official government documentations, accounting and many others. One may understand which kind of the file it is just by looking at the file signature: the Excel 97-2003 files start with D0 CF 11 E0 A1 B1 1A E1 signature, HTML ones start with <html or some other HTML opening sign while XML file starts with XML or any other XML markup language sign. New Excel version uses xlsx instead of xls.
How to open a .XLS file
Open a .XLS file on Windows
- 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
- 2 Double-click your .XLS file if you have an app for .xls files on your computer. In case it does not open, move on to step three.
- 3 Right-click your .XLS file -> select .
- 4 Choose Microsoft Excel in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .xls files" and click OK.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Windows
- Microsoft Excel paid
- LibreOffice Calc open-source
- Apache OpenOffice Calc open-source
- WPS Spreadsheet freemium
- ONLYOFFICE Spreadsheet Editor freemium
- Gnumeric open-source
- SoftMaker PlanMaker paid
- Calligra Sheets open-source
Open a .XLS file on macOS
- 1 In the Finder app, locate your .XLS file.
- 2 Just double-click your .XLS file in order to automatically launch the program which is connected with it.
- 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select .
- 4 If it isn't in the list, choose and find the application manually.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for macOS
- Microsoft Excel paid
- LibreOffice Calc open-source
- Apache OpenOffice Calc open-source
- Apple Numbers free
- WPS Spreadsheet freemium
- ONLYOFFICE Spreadsheet Editor freemium
- SoftMaker PlanMaker paid
- Calligra Sheets open-source
Open a .XLS file on Linux
- 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
- 2 Double-click the file.
- 3 Or choose another program by right-clicking the file -> .
- 4 Install LibreOffice Calc (if it is not installed on your computer) from the software centre, repository or Flathub.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Linux
- LibreOffice Calc open-source
- Apache OpenOffice Calc open-source
- WPS Spreadsheet freemium
- ONLYOFFICE Spreadsheet Editor freemium
- Gnumeric open-source
- SoftMaker PlanMaker paid
- Calligra Sheets open-source
- Python xlrd open-source
Open a .XLS file on Android
- 1 Launch Files or another file management app.
- 2 In Downloads, find the .XLS file and open it by tapping.
- 3 A list of apps capable of opening the file will be shown. Tap Microsoft Excel and press Always to permanently connect the file type with this app.
- 4 No apps able to open this file? Download Microsoft Excel from the Google Play Store.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Android
- Microsoft Excel paid
- Google Sheets freemium
- WPS Spreadsheet freemium
- ONLYOFFICE Spreadsheet Editor freemium
- SoftMaker PlanMaker paid
- Zoho Sheet freemium
Open a .XLS file on iPhone / iPad
- 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
- 2 Tap the .XLS file you want to open.
- 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
- 4 Touch and hold the file to get the context menu -> choose -> select Microsoft Excel from the list of apps.
- 5 If there is no such option, download the app first from the App Store and then tap the document again.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for iPhone / iPad
- Microsoft Excel paid
- Google Sheets freemium
- Apple Numbers free
- WPS Spreadsheet freemium
- ONLYOFFICE Spreadsheet Editor freemium
- SoftMaker PlanMaker paid
- Zoho Sheet freemium
Open a .XLS file online
- 1 Move to the online viewer at the top of this page.
- 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Online
- Microsoft Excel paid
- Google Sheets freemium
- Apple Numbers free
- ONLYOFFICE Spreadsheet Editor freemium
- Zoho Sheet freemium
- Aspose.Cells Viewer freemium
More details about opening .XLS files
Microsoft Excel running under Windows offers the most precise rendition of the file contents (formulas, macros in Visual Basic for Applications, charts, pivot tables, password security, and object embedding), but Microsoft 365 and Office are needed. The open source LibreOffice running on Linux, macOS, or Windows is completely free and offers good support of .XLS files and is recommended as a solution if converting to another file format (.xlsx, .ods, .csv, .pdf, and so forth) is desirable. In turn, Gnumeric works under Linux; both Gnumeric and LibreOffice Calc provide support for .xls files as well as batch processing (conversion to a new format or other operation) using a terminal without UI. On macOS and iOS, the Apple software Numbers offers importing .xls file for opening, modification, editing, or converting to another format, while some of advanced Excel features might have been changed or stripped, as well as on iOS where the Apple software Numbers is present as well. For iOS, Android, the software applications available that provide basic support of opening and viewing the file: WPS Office, Microsoft Excel mobile, Google Sheets, ONLYOFFICE, as well as Numbers.
The other solution is opening the file from inside the spreadsheet application, after which the association in the OS needs checking. The reason for inability to read such files might be a presence of .xls suffix with non-.XLS content (e.g., HTML file). If a suspect file is encountered, checking with a hex viewer as for header first (the identification tools also exist for that reason) is a proper method.
Technical details
Main .xls version format is BIFF8 which stands for Excel 97-2003 binary workbook. It lies inside compound Microsoft Compound File Binary Format or OLE2 Structured Storage Container. Valid OLE .xls should start with D0 CF 11 E0 A1 B1 1A E1 (OLE compound file signature) at offset 0. Streams in OLE structure that usually belong to Excel include Workbook, SummaryInformation, and/or DocumentSummaryInformation and when there are VBA macros, VBA stream and sometimes "_VBA_PROJECT" one. Records-based BIFF consists of 2-byte Type Field, two-byte Length Field and Data of record. Commonly met types include BOF (Begin Of File marker), EOF (End Of File marketer), SST (Shared string table), LABELSST, NUMBER, FORMULA, XF (cell formats), BOUNDSHEET and CONTINUE record type used for multi-block records continuation
Strings in BIFF8 format are most frequently stored using compressed 8bit encoding or UTF-16LE Unicode coding dependent on specific characters. Code-pages were often used by earlier BIFF versions. Worksheets for Excel 97 to Excel 2003 have 65536 and 256 as number of their rows and columns which is significantly less than 1048576x16384 for .xlsx spreadsheet. Official MIME-Type name is application/vnd.ms-excel however web servers serve .xls as application/octet-stream type while HTML-exported files marked with text/html might turn to .xls as well. Compound OLE format itself in not compressed by ZIP and its size depends on Shared strings, formatting, drawings, VBA macros presence and unused space. .xls sizes vary starting from some kilobytes to hundreds of megabytes. .xls password protection might refer to workbook and worksheet protection, file open encryption and VBA project password. Old Excel encryption method is not as good as Office file encryption methods now. Plain text variants of .xls, HTML and xml based ones do not contain any consistent binary format signatures thus content-sniffing must be used after checking absence of valid OLE signature.
How to convert .XLS files
Use .xlsx instead of .xls when the desired workbook version is the one having 1,048,576 rows and 16,384 columns and greater interoperability between all components of Office Open XML technologies. The default command used to convert XLS spreadsheet into XLSX from the headless mode of LibreOffice Calc is libreoffice --headless --convert-to xlsx --outdir output input.xls, however, you can save workbook in .xlsx by using Excel software, except VBA will be deleted and .xlsm file is to be chosen in such case of need.
When conversion is performed on the occasion of database input, scripting, or pure transfer of information, then .csv is used. Sheet number is selected purposefully by the user and appropriate encoding is picked because CSV format has no support for formulas, merged cells and multiple sheets, formatting, and embedded charts and tables; LibreOffice has the following instruction to use when converting to the specified file format: --convert-to csv and, usually, it exports individual sheets one after another.
To make a printout of the document, use --convert-to pdf instruction for --headless execution of LibreOffice software. This conversion option maintains layout that is seen and printed from the screen and loses editability in terms of formula editing and does not preserve hidden sheets.
The reason for the conversion into .ods is usage of an open standard like OpenDocument for which the program is optimized. Check formulas and charts after such type of conversion to ensure their correct work because certain elements from Excel file are converted improperly. pandas can convert to .csv or .json or .parquet or databases, yet, layout, formatting, styles, macros, etc., will be discarded.
| Convert to | Tool | Command / note |
|---|---|---|
| XLSX | LibreOffice Calc | libreoffice --headless --convert-to xlsx --outdir output input.xls Best general-purpose upgrade path; very old BIFF, macros, charts, and external links should be checked after conversion. |
| CSV | LibreOffice Calc | libreoffice --headless --convert-to csv --outdir output input.xls Exports one sheet at a time in many workflows; formulas, formats, charts, merged cells, and multiple sheets are not preserved. |
| LibreOffice Calc | libreoffice --headless --convert-to pdf --outdir output input.xls Useful for printing and sharing a fixed view; formulas remain only as displayed values and layout depends on page settings/fonts. |
|
| ODS | LibreOffice Calc | libreoffice --headless --convert-to ods --outdir output input.xls Converts to the OpenDocument spreadsheet standard; some Excel-specific macros and controls may not translate. |
| HTML | LibreOffice Calc | libreoffice --headless --convert-to html --outdir output input.xls Creates a web-readable table representation; interactive spreadsheet features are lost. |
| JSON | Python pandas | python -c "import pandas as pd; pd.read_excel('input.xls', sheet_name=None).to_json('output.json', orient='records')" Requires an Excel reader engine such as xlrd for .xls; JSON does not preserve spreadsheet styling or formulas as executable formulas. |
Common problems and fixes
Microsoft Excel displays the warning “The file format and extension of ‘…’ don’t match” for filenames whose last extension part is .xls while the data in bytes does not belong to OLE Spreadsheet file types but HTML, XML Spreadsheet 2003, CSV format, or corrupted download. Check whether it belongs to the first bytes of legitimate spreadsheets. A real OLE .xls workbook should start with sequence D0 CF 11 E0 A1 B1 1A E1 at offset 0. If the data are text, change file type extension like .html, .xml and .csv, or convert this spreadsheet.
“Excel cannot open the file because the file format or file extension is not valid” is usually an indicator of data corruption, misnamed of the file, block internet connection, or of some file that does not belong to Excel files but assigned an extension .xls. If such a block exists, disable it to be able to access it. Also, try opening a local instance if possible. "File is already locked for editing by…." means that some other Excel process, a person using that file over computer network or some file ending with .lck or temporary lock file is locking this workbook at this time. So you can turn off other processes.
"This file is not in a recognizable format" means damaged BIFF record or older BIFF formats like Excel BIFF4 and older. In this case first, try repairing the document with Excel and second, try Libreoffice Calc or Gnumeric, otherwise it can only be retrieved from a back-up copy. There is no workaround to password prompting in case of file-open encryption; therefore, make sure the spreadsheet is actually encrypted. Often formula failure or #REF! errors arise due to corrupted external data files; there could be links that do not exist, modified external tools etc. Document layout changes arise because of missing fonts, wrong printer driver, date and number format according to locale, different size pages etc. Files of very large .xls could contain up to 65536×256; therefore, conversion into xlsx is the best way.
Security considerations
Not necessarily are attachments in XLS format safe documents, since they might be created using VBA code, macro sheets from Excel 4.0, Excel 4.0 add-in functions and ActiveX controls, which would help them run the code upon opening or accessing certain data using a link or connection, in order to perform its function or process the information in Excel 97-2003 software. XLS files have also been used for delivering macro malware, or for taking advantage of Office vulnerability in a parser. It is important to keep Microsoft Office, and similar spreadsheet applications like LibreOffice Calc viewer programs up to date regarding all possible vulnerabilities. It is essential not to open any attachments and enable macros on such emails, chats and other forms of files you found on the Internet. Make sure you know about the reason you are supposed to see them, before enabling anything at all, because signed macros can be unsafe if there is no certificate trust from their owner or authority that issued it. Document properties may include author, companies and other additional info.
History and versions
Microsoft brought out its Excel for Mac software product in 1985. In 1987 the file extension “xls” came in handy and started getting widely adopted after Excel migrated to Windows systems from this point onwards. Early implementations employed BIFF streams with several implementations ranging between BIFF2 and BIFF4 during late 1980s and the early 1990s period. From the year 1993 and release of Excel 5.0, it shifted its storing method of workbooks employing OLE compound storage technique and also incorporated VBA macros inside Excel 5.0 workbook.
Release of Excel version Excel 97 which included implementation of BIFF8 stream and incorporation of Unicode came up during 1997 and remained as dominant version of .xls until Excel version in the year 2003. The Excel software products Excel 2000, Excel 2002 and Excel 2003 maintained the default format BIFF8 while implementing several enhancements with same file format system. The newer version Excel 2007 adopted ZIP-based .xlsx as new file format, however, was backward capable of both reading and writing .xls file format files. Nevertheless, it was not long till MS-XLS specifications got published along with Microsoft’s Office file format specification documentation.
Related formats
The format that is currently the default format for Excel workbooks is called XLSX. It employs ZIP-based Open XML of Office, allows a much larger grid than the old format XLS, and can be regarded as a better solution for data exchange since it is supported not only by Microsoft Office Excel but also by LibreOffice Calc, Google Sheets and even some libraries. There are no macros in this format; for workbooks that contain VBA macro projects, use XLSM. XLSB is the name of binary workbook format of Excel; its files may open more quickly, and be smaller on very large files for very large files, however the format itself is supported by fewer programs than .xlsx outside Excel in such cases. ODS means the format of OpenDocument Spreadsheet; it is standardized and an open format, however it does not support all features like specific formulas, controls or Excel formatting. CSV is a format for plain delimited text of one data table without formulas, formatting and multiple sheets. And also Excel supports HTML, HTM exports.
No comments yet. Be the first to share your experience with this file type.