The Excel message “The file format and extension of [filename] don’t match” means Excel cannot confirm that the file’s contents match its filename ending, such as .xlsx. Check the file’s real source and extension first; don’t simply rename it, because changing the ending does not convert the file and may hide corruption or a security risk.
What the file format and extension error means
An extension is the part of a filename after the final period: in budget.xlsx, the extension is .xlsx. It tells Windows and Excel what kind of file to expect. The format is the structure of the data actually stored inside the file. Excel checks whether those two things appear consistent when it opens a workbook.
The warning is not a precise diagnosis. It can appear when a file was given the wrong extension, when a download or copy is incomplete, or when the workbook’s contents have been damaged. It may also happen when software creates a file using an unusual or unsupported format. A file can have a familiar name and still contain something other than an Excel workbook.
For example, a comma-separated text file called sales.xlsx is still text; renaming it did not turn it into an Excel workbook. Conversely, an actual Excel workbook saved with an incorrect ending may sometimes be recovered by identifying its true format and opening or resaving it appropriately. Treat the message as a reason to verify the file, not as proof that one particular fix will work.
Why Excel files and extensions get out of sync
Common causes include human error, downloads that did not finish, and file conversions performed by another program. Someone may rename a file to make it easier to recognize, or a website may provide a file with an inaccurate name. Email gateways, cloud synchronization, removable drives, and network interruptions can also leave a file incomplete or altered.
Files exported from accounting, reporting, or database software deserve particular attention. An export may be CSV or HTML even if the name ends in .xlsx, or it may use an older Excel format. Some systems produce a valid file that Excel can import but that is not a native workbook. A mismatch can also result from a file that was renamed more than once, for example report.xls.xlsx, especially if Windows is hiding known extensions.
Corruption is another possibility, but it is not the only one. A damaged workbook might be missing required internal parts, while a mismatched file may be perfectly intact but mislabeled. If the file came from an unfamiliar sender or unexpected website, there is an additional concern: a misleading extension can disguise an unsafe file. Verify the sender and source before attempting to open it.
Check the file’s real extension and source
Start with the original file, and make a copy before trying recovery steps. In Windows 11 File Explorer, choose View > Show > File name extensions. In Windows 10, use the View tab and select File name extensions. This reveals endings Windows may otherwise hide. A name displayed as report.xlsx could actually be report.xlsx.csv if extensions are hidden.
Next, consider where the file came from and what the sender intended to provide. Ask the sender to confirm the format or send the original again. If it came from a website, download it again from the official source and wait for the download to finish. If it is in OneDrive or another synced folder, confirm that it has fully downloaded and is not merely an online placeholder. Compare file size with another copy if one exists; an unexpectedly tiny file can indicate an incomplete transfer, though size alone cannot prove that a file is valid.
- Check whether the expected file type is a workbook, CSV, PDF, or another format.
- Look for extra endings or spelling errors, such as
.xlxsinstead of.xlsx. - Keep the original unchanged and perform experiments on a duplicate.
- If the file is unexpected or from an untrusted source, do not bypass warnings just to view it.
Try safe fixes in a sensible order
For a file you trust, use this order so you can distinguish a naming issue from a damaged file. First, obtain a fresh copy from the original sender or source if possible. A clean download or resend is usually safer and more reliable than trying to rebuild a damaged workbook. If you know the file is actually a CSV, HTML document, or older Excel file, use the appropriate import or opening method rather than changing its name at random.
- Make a backup. Copy the file to a local folder and leave the original untouched.
- Confirm the intended format. Check with the creator, website, or exporting application. Do not infer the format from the filename alone.
- Correct only a confirmed naming mistake. If the creator confirms it is an Excel workbook saved with the wrong extension, change the ending on the copy to the confirmed type. Changing a name is not a conversion, so stop if the format is uncertain.
- Open it from Excel. In Excel for Microsoft 365 on Windows, select File > Open > Browse, select the file, and choose Open. If Excel offers a format or repair choice, follow it only when the source is trusted.
- Save a recovered workbook as a new file. Use File > Save As and choose the format that matches what you need, such as Excel Workbook (
.xlsx).
Avoid repeatedly changing extensions until Excel accepts the file. That can make the filename more confusing without repairing anything. Also avoid uploading confidential workbooks to random online “repair” sites: the file may contain private financial, customer, or employee data. If the workbook is valuable, ask its creator or your organization’s IT support for the original or a managed recovery option.
Use Open and Repair when the file is a workbook
If you have good reason to believe the file is an Excel workbook but it will not open normally, Excel for Windows includes Open and Repair. In Excel, select File > Open > Browse. Select the workbook in the dialog, click the arrow beside the Open button, and choose Open and Repair. If offered, try Repair first. If that fails, the Extract Data option may recover values and formulas, although it may not preserve formatting, charts, or other workbook features.
This tool is not guaranteed to work, and Excel may not offer it for a file it cannot identify as a workbook. If repair succeeds, inspect the result carefully: check important sheets, formulas, dates, charts, links, and macros before relying on it. Save the recovered version under a different name so the damaged original remains available. If the workbook contains macros, use a macro-enabled format only when those macros are expected and trusted.
For a workbook stored on a network or removable drive, copy it to a local folder before attempting repair. A connection problem can interrupt reading or writing, and working on a local copy helps protect the original. If repair fails, ask for a fresh copy or a backup version. Excel’s recovery feature cannot recreate information that was never fully downloaded or has been overwritten.
Choose the right format instead of renaming blindly
Excel’s common formats have different purposes. .xlsx is the standard XML-based workbook format and does not store VBA macros. .xlsm is a macro-enabled workbook. .xlsb is a binary workbook format. .xls is the older Excel 97–2003 workbook format. A CSV file, usually ending in .csv, stores plain tabular text rather than a full workbook: it does not preserve multiple worksheets, formatting, or workbook features such as charts.
If the file is genuinely CSV, open it as a text or CSV import rather than pretending it is an .xlsx workbook. In Excel for Windows, use Data > From Text/CSV to review the import and choose how text and columns are interpreted. Once the data is loaded, use File > Save As and select Excel Workbook (.xlsx) if you need multiple sheets, formatting, or formulas. Saving a CSV as .xlsx is an actual conversion through Excel; changing .csv in File Explorer is not.
Choose a macro-enabled format only if you need macros and trust their source. If you save a workbook containing VBA as .xlsx, Excel may warn that the format cannot retain those macros. Pay attention to that warning rather than assuming every workbook should end in .xlsx. The right extension depends on the contents and features you need to preserve.
Distinguish this warning from security and compatibility messages
Excel’s format-and-extension warning is different from a Protected View notification. Protected View commonly displays a banner for files considered to have come from an internet or otherwise untrusted location. A file can have a valid extension and still open in Protected View, and a format mismatch can occur without Protected View being the cause. Do not disable Protected View or broadly relax security settings to solve a format mismatch; that does not convert or repair a file.
Similarly, a message about an unsupported feature or a file created by a newer application is not necessarily the same problem. If a workbook opens but some content is unavailable, the issue may be compatibility rather than a false extension. Keep a copy in its original format and consult the program that created it before saving to another format, because conversion can remove features.
Files that contain macros or came from unknown senders should be treated cautiously. Do not enable macros simply because Excel asks, and do not trust a file solely because its name ends in .xlsx or .xlsm. Extensions are useful clues, not security guarantees. When the source cannot be verified, delete the file or ask your IT department to assess it rather than trying to force it open.
Opening files on Mac or Excel for the web
The recovery steps above describe Excel for Microsoft 365 on Windows. Excel for Mac has similar ways to open and save workbooks, but its file dialogs and menu layout can differ; the Windows-specific File > Open > Browse sequence may not match the Mac interface exactly. If you do not see an equivalent repair option, try a verified fresh copy or open the file in desktop Excel for Windows through your organization’s approved support route.
Excel for the web can open many standard workbook files, but it does not provide every desktop recovery and file-management option. If the web version cannot open a file, that alone does not establish that the file is corrupt. Download a trusted copy and try the desktop app, or request a new export from the source. Keep the original untouched until you have checked whether the replacement opens correctly.
Frequently Asked Questions
Can I fix the error by changing .xlsx to .xls?
No, not by renaming alone. The extension must describe the data format inside the file. Change it only if the creator confirms the actual format; otherwise, request a correct copy or import the file using its real format.
Does this message mean my workbook is corrupted?
Not necessarily. The file may have the wrong extension, be incomplete, or use a format Excel cannot recognize. Corruption is one possibility, which is why checking the source and trying a fresh copy should come before recovery attempts.
Is it safe to click through the warning?
Only proceed when you trust the source and understand what the file is supposed to contain. A familiar filename or extension does not establish safety. If the file was unexpected, verify it with the sender or your IT team first.
What should I do if Open and Repair does not work?
Keep the original, ask for a fresh copy, and confirm which application and format created it. If the data is important, contact your organization’s support team. A repair tool cannot guarantee recovery, especially when a file is incomplete or its contents are not actually an Excel workbook.
Will saving the file as .xlsx preserve everything?
Not always. CSV files lose workbook features when exported, and .xlsx cannot store VBA macros. Choose the format that supports the workbook’s required content, then review Excel’s compatibility warnings before confirming a conversion.
Related
- Excel Goal Seek Shortcut: Open It, Set a Target, Solve
- How to Enable Solver in Excel on Windows and Mac
- Flash Fill in Excel: Keyboard Shortcut and How to Use It
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- Excel Can’t Push Non-Empty Cells: How to Fix ItExcel shows this error when inserting cells, rows, or columns would force existing worksheet content beyond the sheet’s…
- Google Sheets Filter Search: Find Data and Fix IssuesTo search data with a filter in Google Sheets, select your data range, choose Data > Create a…
- Excel Page Breaks Won’t Reset? Fix View and Print SettingsTo reset page breaks in Excel for Microsoft 365 on Windows, select the worksheet, choose View > Page…
- Fix Data Validation in Excel: Lists, Rules, and ErrorsTo fix data validation in Excel, select an affected cell, choose Data > Data Validation, check the Settings…
- Excel Not Responding: Fix Margins That Do Not Fit a PageIf Excel says the margins do not fit the page and then stops responding, first give it a…
- Excel Not Responding on Windows 11? Fix It SafelyIf Excel says “Not responding” on Windows 11, first give it a moment—large calculations or files can temporarily…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.