"Excel cannot open the file because the file format or file extension is not valid" means Excel looked inside the file and did not find what the extension promised. Either the file is a different type with the wrong name (for example an old .xls, a CSV or a web page saved as .xlsx), or it really is an .xlsx workbook whose internal structure is damaged or cut short. Check the file size and type first, try the right extension, then use Excel's Open and Repair. If that fails, a file repair tool can rebuild the workbook from what is left.
The full message usually reads: Excel cannot open the file 'Budget.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file. The two halves of that last sentence are the two possible causes, and the steps below help you tell which one you have.
Why Excel shows this error
A modern .xlsx file is really a ZIP archive full of XML files: one for each sheet, one for shared text, one for styles and a few that tie everything together. When you open it, Excel unzips it in memory and reads those parts. If the archive can't be unzipped, or a key part is missing, Excel gives up with this message rather than guessing.
| Cause | How it usually happens | Typical sign |
|---|---|---|
| Wrong extension | A file was renamed, or a program exported CSV, HTML or old .xls data with an .xlsx name | File size looks normal and the file opens fine once renamed |
| Incomplete download or copy | Email attachment, browser download or USB copy interrupted | File is smaller than expected, or 0 KB |
| Damaged ZIP container | Crash or power cut while saving, failing drive, sync conflict | Normal size, but won't open under any extension |
| Recovered from a failed or formatted drive | Data recovery software rebuilt the file from scattered pieces | Many recovered workbooks show the same error |
| Macro or binary workbook named .xlsx | An .xlsm or .xlsb file saved or renamed with the wrong extension | Opens once given its proper extension |
Step 1: Check what the file really is
Before trying repairs, find out what is actually inside. It takes a minute and often solves the problem outright.
- Look at the size. Right-click the file, choose Properties and check Size. A 0 KB file is empty, and nothing can repair it. Get it again from wherever it came from.
- Peek at the first characters. Make a copy of the file, right-click the copy and choose Open with > Notepad. Look at the very start:
PKmeans it is a ZIP-based file, so a genuine .xlsx, .xlsm or similar.- Odd characters starting with
ÐÏmean it is an older binary Office file, usually .xls. <html,<tableor<?xmlmean it is a web page or XML export.- Plain rows of text separated by commas or tabs mean it is a CSV or text file.
- Mostly zeros or blank space means the content is missing, which is common after a crash or a failed recovery.
- Close Notepad without saving.
To see file extensions in Windows 11, open File Explorer and choose View > Show > File name extensions. In Windows 10, tick File name extensions on the View tab.
Step 2: Try the right extension or open it from inside Excel
If the peek suggested another format, rename a copy to match: .xls for the ÐÏ type, .csv for comma-separated text, .htm for a web page. For a PK file that still won't open, try .xlsm in case it contains macros.
You can also skip renaming. In Excel choose File > Open > Browse, set the file type box to All Files and open the file directly. Excel then looks at the content rather than trusting the name, and may show a different warning such as "the file format and extension don't match", which you can accept if you trust the source.
Once it opens, use File > Save As and save it as an Excel Workbook (.xlsx) so the name and format finally agree.
Step 3: Use Excel's Open and Repair
If the file is a genuine .xlsx and still won't open, it is damaged. Excel has a built-in repair:
- In Excel, choose File > Open > Browse.
- Select the workbook, but don't double-click it.
- Click the small arrow next to the Open button and choose Open and Repair.
- Click Repair first. If that fails, repeat and choose Extract Data, which tries to pull out values and, optionally, formulas.
Open and Repair works well for small problems inside the sheets. It often fails when the ZIP container itself is broken, which is exactly the situation that triggers this particular error, because Excel can't get far enough into the file to start repairing.
Step 4: Look for an earlier, healthy copy
- OneDrive or SharePoint. If the workbook was synced, right-click it on the OneDrive website and choose Version history. Restore a version from before the problem started.
- Previous Versions. Right-click the file in File Explorer, choose Properties and open the Previous Versions tab. Copies appear here only if File History or restore points were protecting that folder.
- The original source. Download the attachment again, ask the sender to resend it, or copy it again from the USB drive or network share. A fresh copy fixes most "downloaded file won't open" cases.
- Unsaved or AutoRecover copies. In Excel, choose File > Info > Manage Workbook > Recover Unsaved Workbooks to see whether a recent autosaved copy exists.
Step 5: Rebuild the workbook with File Repairer
When the extension is right, Open and Repair fails and there is no older copy, the file needs rebuilding from its pieces. That is what File Repairer does for Excel files. It salvages the damaged ZIP container, recovers broken XML, rebuilds the sheet list and the links between parts, and brings back data, formatting, formulas and sheets as far as the file allows. Older .xls workbooks are repaired and saved as .xlsx, with their formulas kept as working formulas.
The workflow is simple:
- Drag the workbook, or a whole folder of them, into File Repairer.
- Run the repair and check the preview. You see the recovered sheets and a "what was recovered" panel before you save anything.
- Save the repaired copy. It gets " (repaired)" added to the name, and your original is never changed or overwritten.
Checking, repairing and previewing are free, so you can see whether your data is there before deciding anything. If the workbook is too damaged to rebuild as a spreadsheet, Tools > Extract Text & Data pulls every readable value into a new file. Our guide to repairing a corrupted Excel file covers other Excel errors, and recovering text from a damaged document explains the rescue route in more detail.
Be realistic about partial results. If part of the workbook was overwritten or never saved, that part can't be brought back by any tool. A repair can only work with the data still in the file.
If this happened to files from data recovery
Workbooks rescued from a formatted, crashed or failing drive are the most common source of this error, often by the dozen. Recovery software finds the file's start and size, but if the drive was fragmented it may stitch in pieces from somewhere else. The result has the right name and size but a broken inside.
File Repairer does not recover deleted files or read failing drives. Recover the files first, onto a different drive, then drag the whole recovered folder into File Repairer. Tools > Check Files for Damage marks each file as Damaged or No damage found without changing anything, so you can see the scale of the problem before repairing. The guide on recovered files that won't open walks through that process, and the supported file types list shows everything else it can repair.
Frequently asked questions
Can I fix this error just by renaming the file?
Only if the file is a different type wearing the wrong name, such as an .xls or CSV saved as .xlsx. If the file is a genuine .xlsx with a damaged inside, renaming won't help and it needs repairing.
Why does a workbook I was sent by email show this error?
The attachment may have been cut short during sending or downloading. Download it again or ask the sender to resend it before trying any repair.
Will repairing the workbook keep my formulas?
File Repairer recovers formulas as well as values, sheets and formatting wherever the data survives. Parts of the file that were overwritten or never saved can't be restored, so some repairs are partial.
