Fix Excel File Format and Extension Do Not Match Warning
Question details
The user encounters a prompt stating that the file format and extension do not match when attempting to open an XLS or XLSX file.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Opening a spreadsheet file that was downloaded from the internet, exported from third-party software, or manually renamed.
- Observed behavior
- Excel displays a warning prompt preventing the file from opening directly, indicating a discrepancy between the file's contents and its .xls or .xlsx extension.
Verify that the spreadsheet comes from a trusted source before proceeding, as bypassing extension mismatch warnings on unknown files can expose your device to security risks.
Bypass the Warning and Save as a Modern Format
If you are certain the file is safe, you can instruct Excel to open it anyway and then save a fresh copy in the verified XLSX format to eliminate future warnings.
This is the most common and effective method for resolving compatibility issues with files exported from older systems or third-party web tools.
When Excel displays the warning prompt 'The file format and extension don't match', click 'Yes' to proceed and open the file.
Once the file is open and the data is visible, click on the 'File' tab in the top-left corner of the ribbon and select 'Save As'.
Choose the location where you want to save the file. In the 'Save as type' dropdown menu, select 'Excel Workbook (*.xlsx)'.
Click 'Save'. You can now use this newly saved file without triggering the mismatch warning.

Manually Correct the File Extension
Sometimes a file exported from another program is actually a CSV or HTML file disguised with an .xls extension. Correcting the extension manually resolves the error.
Use the Open and Repair Feature
If the file contents are genuinely corrupted, Excel's built-in repair utility might recover the data and fix the format discrepancy.
Open Any Spreadsheet Format Effortlessly with WPS Office
If Microsoft Excel frequently blocks your workflow with strict extension and compatibility warnings, WPS Office offers a flexible, highly compatible alternative. It natively handles legacy files, mismatched extensions, and third-party exports smoothly without compromising your data.
- 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheet, go to 'Menu' > 'Open', and select your problematic XLS or XLSX file.
- 3. Save as Standard Format: Once the file opens successfully, go to 'Menu' > 'Save As' and select 'Microsoft Excel Workbook (*.xlsx)' to ensure future compatibility.

Frequently Asked Questions
Why does Excel say the file format and extension don't match?
This is a security feature introduced in modern versions of Excel called Extension Hardening. It detects when the underlying file structure (like plain text CSV or HTML) does not match the file extension (like .xls) displayed in its name. This prevents potentially malicious files from executing on your computer.
How can I prevent this error when exporting data from an online portal?
Many older web portals and third-party databases generate HTML or CSV data and automatically attach an .xls extension so it opens in Excel. To prevent this, check if the export tool has an option to natively export as CSV or XLSX. Otherwise, you will need to open the file and re-save it manually.
Can I permanently disable the format and extension warning in Excel?
It is possible to disable this warning by modifying the 'ExtensionHardening' key in the Windows Registry. However, Microsoft strongly advises against doing this, as it disables a critical security checkpoint and makes your computer vulnerable to disguised malware.
Does this mismatch warning mean my Excel file contains a virus?
Not necessarily. While it can be an indicator of a disguised malicious file, it is much more frequently caused by third-party applications exporting reports improperly. Always verify the source of the file; if it was generated by a trusted work system, it is likely safe.




