Excel File Format or Extension Is Not Valid: What It Means and How to Fix It

Quick answer

This error usually means the file’s name and the file’s actual format don’t match — often because something was renamed by hand, exported by another program with the wrong extension, or saved in an obscure format Excel doesn’t recognize. The 30-second first check: confirm the file is genuinely an Excel file. Most other guides bury this in fix number five. We’re putting it first because it’s the highest-yield, lowest-risk diagnostic by a wide margin.

Before you start

Make a copy of the file before changing anything, especially before renaming the extension. If you rename and rename again and lose track of what was what, the original copy is your safety net.

Don’t disable Protected View as a “fix” before you’ve tried anything else. It doesn’t fix this error; it just removes a security check that may be unrelated to the problem. Try the diagnostics below first, in order.

If the file is from a managed source — QuickBooks export, accounting software, an internal portal — see the work-device section before troubleshooting deeply.

What this means

The full error message is usually: “Excel cannot open the file ‘[filename].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.”

Excel is telling you it expected one kind of file and got something else. Either the file’s contents don’t match what its extension claims it should be, or the file’s contents are damaged enough that Excel can’t recognize the format at all.

Two important distinctions:

  • Wrong extension, intact file. The file is a valid Excel workbook (or some other format Excel can read), but its filename is wrong. Common with files exported by accounting software, downloaded from web apps, or manually renamed.
  • Right extension, damaged file. The filename is correct but the contents are corrupted. This is the same family of problem as “Excel file is corrupted and cannot be opened” and the fixes overlap heavily.

The check below distinguishes the two within about 30 seconds.

Where this error appears

  • Excel desktop on Windows 10, Windows 11, and macOS — most common surface.
  • Files exported from QuickBooks, Xero, Zoho, or other business apps — these write .xlsx files programmatically and sometimes produce files Excel rejects, even though the data inside is fine.
  • Files downloaded from web portals — banking, payroll, HR, or admin dashboards that generate exports on the fly.
  • Files attached to Outlook emails that were truncated mid-download.
  • Files renamed by hand — sometimes innocently, often by a user who thought “I’ll just change the .xls to .xlsx” without realizing those are different formats.
  • Files from external drives or USB sticks that were ejected during a copy.

Common causes

Ordered by how often they’re the actual culprit:

  • The file has the wrong extension. Someone — or some app — gave it an .xlsx name without saving it in .xlsx format. The contents are usually a different format (.xls, .html, .csv, even an HTML report dressed up as a spreadsheet).
  • The file was truncated during transfer. Email clipped the attachment, the download cut off, the USB stick disconnected mid-copy.
  • The file was exported by software that doesn’t strictly follow the .xlsx specification. QuickBooks, older versions of various accounting tools, and some custom in-house export utilities are notable offenders.
  • The file is genuinely corrupted — same problem as Excel file is corrupted and cannot be opened.
  • Excel’s Protected View blocks an attachment and the resulting cascade of errors looks like an extension problem when it isn’t.

Fixes to try first

Work through these in order. The first one is the highest-yield diagnostic and takes 30 seconds.

1. Check what the file actually is

Before assuming corruption, confirm the file matches its extension. This is the fix that most other guides put at position five — and it’s the one that solves the problem most often.

On Windows:

  1. In File Explorer, click View → Show → File name extensions to make sure extensions are visible.
  2. Right-click the broken file → Properties.
  3. Look at the Type of file field. It should say Microsoft Excel Worksheet (.xlsx) or Excel 97-2003 Worksheet (.xls).
  4. If the type doesn’t match the extension, that’s your problem.

The faster method: open the file in Notepad. Right-click the file → Open with → Notepad (or any text editor).

  • If you see binary garbage with PK at the very start, it’s a real .xlsx file (the PK is the ZIP header — .xlsx files are ZIPs).
  • If you see readable HTML with <html> and <table> tags, the file is actually an HTML report saved with an .xlsx extension. Save it as .html, then open it in Excel — Excel reads HTML tables fine.
  • If you see plain text with commas separating values, it’s a CSV. Rename the file to .csv and Excel will open it properly.
  • If you see binary garbage that doesn’t start with PK, it might be an old .xls file. Rename to .xls and try again.
  • If you see almost nothing — the file is suspiciously small — the download was probably truncated. Re-download from the source.

This single check resolves the majority of “format or extension not valid” cases. Most other guides bury it under more dramatic-sounding methods.

2. Re-download or re-export the file

If the file came from email or a web portal, the simplest fix is often to get a fresh copy:

  • For email attachments: ask the sender to re-send, or open the email on a different device to download afresh.
  • For web app exports: log back into the source app and re-run the export. Don’t rely on a browser’s saved copy.
  • For files copied from a USB stick or network share: copy them again, making sure the source is still connected and the destination has space.

A truncated file isn’t going to repair itself. A fresh download bypasses the problem entirely.

3. Use Open and Repair

If the file is genuinely an Excel file with damage:

  1. Open Excel with no workbook.
  2. File → Open → Browse.
  3. Click the broken file once to highlight it.
  4. Click the dropdown arrow next to Open.
  5. Choose Open and Repair. Try Repair first; if it fails, try Extract Data.

This is the same diagnostic flow as the broader Excel file corrupted recovery — and if Repair succeeds, save the result under a new name and stop.

4. Check OneDrive or SharePoint version history

If the file lives in cloud storage, the cloud version may be intact even when your local copy isn’t. Right-click the file in File Explorer → Version history, or open it via onedrive.com → three-dot menu → Version history. An earlier version often has a working copy.

Advanced fixes

If the basic checks didn’t resolve it, the file is more genuinely damaged.

Unblock the file

Windows attaches a “Mark of the Web” to files downloaded from email or the internet, and sometimes the resulting Protected View interaction produces this error.

  1. Right-click the file → Properties.
  2. On the General tab, near the bottom, look for an Unblock checkbox. If it’s there, tick it.
  3. Click Apply, then OK.
  4. Try opening the file again.

If there’s no Unblock option, this isn’t the problem. Move on.

Force the file open in Excel as a known format

If you suspect a file is a renamed .xls or HTML table, force Excel to open it as that format:

  1. Open Excel with no workbook.
  2. File → Open → Browse.
  3. In the dropdown next to the filename field (it usually says “All Excel Files”), choose All Files (*.*).
  4. Select the broken file and click Open.
  5. Excel will sometimes display a “format or extension is not valid” warning; click Yes to open anyway.

Excel will try to interpret the file based on its actual contents. If it succeeds, save the result as a clean .xlsx under a new name.

About third-party repair tools

Search results for this error are dominated by paid recovery tools — Stellar Repair for Excel, EaseUS Fixo, Wondershare Repairit, 4DDiG, and others. They have a place when the file is genuinely corrupted and Excel’s own Open and Repair can’t recover it.

A few honest points:

  • They are not magic. Success rates on genuinely damaged files vary widely.
  • Most preview your file for free and only charge to save the recovered output.
  • Don’t upload a sensitive workbook to an “online repair” service without checking the vendor’s data policies and your employer’s rules.

The decision tree on Excel recovery tools compares them honestly. We don’t take affiliate money from any of these vendors.

If you are on a work or school device

  • Files from QuickBooks, Sage, Xero, HMRC tools, ADP, and similar exports are a recurring source of this error because those tools don’t always write strict .xlsx. The fix is usually method 1 above (open in Notepad — the file is often actually HTML or CSV) or asking the source app to export in a different format.
  • Don’t disable Protected View as a workaround. It doesn’t repair anything, and on managed devices the setting may be enforced by Group Policy.
  • Check version history in OneDrive, SharePoint, or Teams before going further. Cloud-stored files often have a clean earlier version.
  • Talk to IT before installing a third-party repair tool. Managed environments commonly block third-party software, and uploading a work file to a vendor’s online repair service may violate data handling rules.

If you’re the de facto IT person at a small business and this keeps happening with the same export from the same tool, the export itself is the problem. Look for an updated version of the source tool or a different export format (CSV, .xls) that works around the bad .xlsx output.

When to stop

Stop when:

  • You’ve identified the file as a different format (HTML, CSV, .xls) and either renamed it or re-exported. You’re done.
  • You have a usable copy of the data from version history or a re-download.
  • Open and Repair has either succeeded or failed, and the file is not business-critical.
  • The drive is misbehaving — slow reads, other files affected, SMART warnings. Fix the storage problem first.
  • You’ve spent more time on recovery than re-creating the data would take.
  • The file contains sensitive information and the only remaining options involve uploading it to a third-party server you don’t trust.

A renamed file that opens cleanly in Excel is a complete win. A re-downloaded file that opens cleanly is a complete win. There’s no medal for fighting a 5% chance of full recovery for an extra two hours.

  • Excel file is corrupted and cannot be opened — the broader recovery flow when the file really is damaged rather than mislabeled.
  • Which Excel recovery tool fits which scenario — honest comparison of paid recovery tools and when none of them are needed.

Official references

FAQ

Why does Excel say the format is invalid when the file ends in .xlsx?

Because the contents don’t match what an .xlsx file is supposed to look like. The file might actually be an HTML table, a CSV, an old .xls file, or a truncated download. Open it in Notepad — the first few characters tell you what it really is.

Can I just rename the file from .xlsx to .xls and have it work?

Sometimes — if the file is genuinely an old .xls file with the wrong extension. Don’t blindly rename without checking first; if the file is HTML or CSV in disguise, renaming to .xls won’t help and may make troubleshooting harder. Use the Notepad check above first.

Why does my QuickBooks export trigger this error?

QuickBooks (and several other business tools) sometimes write Excel exports that don’t fully comply with Microsoft’s .xlsx specification. Open the file in Notepad — if you see HTML tags, the export is actually HTML wearing an .xlsx label. Rename it to .html, open in a browser, and copy the table into Excel. Or in QuickBooks itself, look for an option to export as CSV instead.

Should I disable Protected View?

No. Protected View doesn’t cause this error in any meaningful way, and disabling it weakens your security without fixing anything. The error is about the file’s contents, not about Excel’s security model.

The file used to open fine — what changed?

Either the file got damaged in transit (re-download or restore from backup), an Excel update changed how strict the parser is (try Open and Repair), or something modified the file in a way that broke the format (sync conflict, an automation tool, an add-in). Check OneDrive or SharePoint version history for an earlier good copy.

My file shows zero bytes when I check Properties — is that recoverable?

No. A 0-byte file means there’s nothing in it — Excel isn’t seeing damaged content; it’s seeing no content at all. Re-download from the source or restore from backup. There’s nothing to repair when the file is empty.

↑ Back to top