Excel File Extension: .xlsx vs .xls Explained
In this article
The file extension for Excel workbooks is .xlsx for files created in Excel 2007 and later, and .xls for older versions (Excel 97–2003). If you see a file ending in .xlsm, it contains macros; .xlsb is a binary format; and .csv is a plain-text format that Excel can open but is not a true Excel workbook. This article explains each extension, how to choose between them, and common issues you might encounter.
Background: Why Excel Has Multiple Extensions
Microsoft introduced the .xls extension with Excel 97 and kept it through Excel 2003. It was based on a proprietary binary format. In 2007, Microsoft switched to the Office Open XML (OOXML) standard, which uses ZIP compression and XML files, and adopted .xlsx as the default. This change made files smaller, more robust against corruption, and easier to integrate with other software. However, older programs and some legacy systems still only recognize .xls.
How the .xlsx Format Works
An .xlsx file is essentially a ZIP archive containing several XML files. When you save a workbook, Excel packages the data, formatting, charts, and formulas into a structured set of folders. This is why you can sometimes rename an .xlsx file to .zip and browse its contents—you’ll see folders like xl/worksheets and xl/workbook.xml. The format supports features like conditional formatting, pivot tables, and advanced charting, and it is the default for Excel 2007 through Excel 365.
How to Choose the Right Extension
Your choice depends on who will open the file and whether it contains macros. Here are the common scenarios:
- .xlsx – Use this for any new workbook without macros. It is the default and compatible with Excel 2007 and later, plus most other spreadsheet programs like Google Sheets and LibreOffice Calc.
- .xls – Use this only when sharing with someone using Excel 2003 or earlier, or with an old system that requires the legacy format. Note that some features (like new chart types) may be lost.
- .xlsm – Use this if your workbook contains VBA macros or ActiveX controls. The “m” stands for macro-enabled. If you save a macro-containing workbook as .xlsx, Excel will strip the macros and warn you.
- .xlsb – Use this for very large workbooks (e.g., hundreds of thousands of rows). The binary format loads and saves faster and produces a smaller file, but it is not as widely supported by third-party tools.
- .csv – Use this for plain data exchange. CSV files are just text with commas separating values. They lose all formatting, formulas, and multiple sheets. Excel opens them but treats them as simple data.
Common Problems and Misconceptions
A frequent issue is the “file extension is not valid” error when trying to open an .xlsx file that was actually renamed from another format. For example, if someone changes a .txt file to .xlsx, Excel will reject it because the internal structure doesn’t match. Another misconception is that .xls is a “newer” format—it’s actually the older one. Also, many people think that saving as .csv preserves formulas; it does not—only the computed values are saved. If you need to keep formulas, stick with .xlsx or .xls.
Comparison: .xlsx vs .xls vs .xlsm vs .csv
Here’s a quick comparison to clarify the differences:
- File size: .xlsx is smaller than .xls for the same data due to ZIP compression. .xlsb is even smaller for large datasets. .csv is the smallest because it’s plain text.
- Compatibility: .xls works with Excel 97–2003 and most modern programs, but some newer features are not supported. .xlsx works with Excel 2007+ and most modern software. .csv works with virtually any text editor or spreadsheet program.
- Macros: .xls can contain macros, but .xlsx cannot. .xlsm is the dedicated macro-enabled format. .csv cannot contain macros.
- Formulas: .xlsx and .xls store formulas. .csv stores only the displayed values.
- Multiple sheets: .xlsx, .xls, .xlsm, and .xlsb support multiple worksheets. .csv supports only one sheet.
Safety and Security Considerations
Be cautious when opening files with macro-enabled extensions like .xlsm or .xlsb, as they can contain malicious VBA code. If you receive an unexpected macro-enabled file, do not enable macros unless you trust the source. Also, be aware that some malware disguises itself by using double extensions, such as invoice.xlsx.exe. Always check the full file name and the actual file type by right-clicking and selecting Properties. For sensitive data, consider password-protecting your workbook or saving it as a read-only PDF, but note that password protection in Excel is not encryption—it can be bypassed by specialized tools.
How to Change the Default File Format
If you frequently need to save in an older format, you can change Excel’s default. Go to File > Options > Save and under “Save files in this format,” choose Excel 97-2003 Workbook (*.xls) or another option. This will make Excel default to that format for all new files. However, be aware that some features may not be available in the older format, and Excel will warn you if you try to use them.
Frequently Asked Questions
What is the file extension for Excel 2019 and Excel 365?
The default file extension for Excel 2019 and Excel 365 is .xlsx. This applies to all modern versions of Excel, including 2010, 2013, 2016, and 2019. The only exception is if you explicitly choose a different format when saving.
Can I open .xlsx files in Excel 2003?
No, Excel 2003 cannot open .xlsx files directly. You would need to install the Microsoft Office Compatibility Pack, which allows Office 2003 to open, edit, and save files in the newer formats. Alternatively, you can ask the sender to save the file as .xls.
Why does my file save as .xls even when I type .xlsx?
If you manually type a different extension in the “Save As” dialog, Excel may override it based on the selected “Save as type” option. To save as .xlsx, make sure the “Save as type” dropdown is set to “Excel Workbook (*.xlsx)” and not “Excel 97-2003 Workbook (*.xls)”.
What is the difference between .xlsx and .xlsm?
The only difference is that .xlsm can contain macros (VBA code), while .xlsx cannot. Both use the same XML structure, but the “m” in the extension signals that macros are allowed. If you try to save a macro-enabled workbook as .xlsx, Excel will remove the macros and warn you.
Is .csv an Excel file extension?
No, .csv is a generic plain-text format that Excel can open and save, but it is not an Excel-specific extension. CSV stands for “comma-separated values” and is used for data interchange between different programs. It does not support formatting, formulas, or multiple sheets.
How do I fix “The file format and extension don’t match” error?
This error occurs when the file’s internal format does not match its extension. For example, if you rename a .txt file to .xlsx, Excel will detect the mismatch. To fix it, open the file in a text editor to see its actual content, or change the extension back to the correct one. If the file is genuinely corrupted, you may need to recover it using Excel’s “Open and Repair” feature (File > Open > select the file > click the arrow next to Open > Open and Repair).