Fix "Excel cannot open the file because the file format or file extension is not valid"

Two very different problems share this error, and the more common one is fixed free, in 30 seconds, by renaming the file.

Your file never leaves your device — repair runs in your browser. 0 bytes uploaded.

Your data is the big block — usually intact. What breaks is the small index. Repair rebuilds it.

Drop a file here or browseTap to choose a file

ZIP · Office · PDF · video · JPG · PNG · RAR/7z · SQLite — repaired right here in your browser. Nothing is uploaded

0 bytes uploadedFree: 3 repairs/day — up to 500 MB video, 100 MB docs & archives, 50 MB photos. Free download. Single repair €5.90. No account required.

Short answer

This tool settles the "file format or file extension is not valid" error by reading your file's real format locally: an HTML or CSV export mislabeled as .xlsx just needs a free rename, not a repair, while a genuinely damaged .xlsx gets its surviving sheet data salvaged and rebuilt into a working workbook. It runs entirely in your browser — the file is read and processed on your machine with 0 bytes uploaded, which you can confirm in your browser's Network tab. The limit: values, formulas, and sheets recover from the readable parts, but formatting, charts, and macros may not, and an encrypted or 0-byte file is out of reach.

Excel file won't open? Find out which problem you have

  1. Drop the file
  2. Local check: what it really is
  3. Rename it — or repair it

This error has two causes: the extension doesn't match what's inside, or the file is a real .xlsx with damaged structure. The tool above settles it instantly — it reads the file's actual format locally and tells you whether you need a free rename or a repair. Either way, the file never leaves your machine.

The exact errors, decoded

Excel cannot open the file 'name.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.

This is the mismatch error: Excel looked inside and found contents that don't match what a .xlsx should contain. Note the message's own second sentence — Microsoft is telling you the extension itself is a suspect. Most of the time, this file isn't corrupted at all.

The file is corrupt and cannot be opened.

This sibling is the damage error: Excel recognized the file as its own format but couldn't parse it. One caveat: on some systems this message comes from an over-strict Protected View setting rather than real damage — if the file fails only on your machine, check File → Options → Trust Center before assuming corruption.

Cause 1: the extension doesn't match the file — free fix

The classic case: a web app's "Export to Excel" button produced an HTML table or a CSV and named it report.xlsx. Excel opens it, sees markup instead of a workbook, and refuses. Other variants: an old-format .xls renamed to .xlsx somewhere along the way, or the reverse.

The fix is renaming: free, no software. Really HTML? Rename to .html. CSV? .csv. An old Excel file? .xls. Excel then opens it by its true format, and you can save a genuine .xlsx from there. The tool above detects the real format, so you're not renaming by trial and error, and no repair is involved, because nothing is broken.

Cause 2: the workbook is genuinely damaged

If the tool confirms the file is a real .xlsx and still unreadable, you're in repair territory. Try Excel's free path first: File → Open → Browse, select the file, click the arrow next to the Open button, and choose Open and Repair — Repair mode first, Extract Data mode second.

When Excel's repair fails, archive-level salvage is the next step: an .xlsx is a ZIP of XML parts, so surviving sheet data can be pulled from a broken container and rebuilt into a working file, right here in your browser; the mechanics are on the Excel repair page. Work on a copy, and stop re-saving the damaged original; every save risks overwriting data salvage could reach.

What this can and can't fix

If the file was never an xlsx (an HTML or CSV export in disguise), repair is the wrong verb, and the honest fix is the rename above; the tool identifies the real format instead of pretending to repair it. Genuine corruption follows the Excel repair limits: cell values, formulas, and sheets recover from readable parts; formatting, charts, macros, and anything in destroyed parts may not; encrypted workbooks still need their password; and a 0-byte file is a data-recovery problem, not a repair problem. A failed repair is never charged.

FAQ

Why does Excel say the file format or file extension is not valid?

Because the file's contents don't match what its extension promises. Either the extension is wrong (an old .xls, a CSV, or an HTML export mislabeled as .xlsx), or the file really is an .xlsx whose structure is damaged. The first case is fixed for free by renaming; the second needs repair.

How do I open a corrupted .xlsx file?

Try Excel's Open and Repair first: File → Open → Browse, select the file, click the arrow next to the Open button, choose Open and Repair. If Excel still refuses, the workbook needs structural repair — an .xlsx is a ZIP of XML parts, and the readable parts can be salvaged even when the container is broken. The tool above does that locally.

Excel file is corrupted and cannot be opened — how do I recover it?

Work on a copy, never the original. Run Open and Repair, then its Extract Data mode. If both fail, run an archive-level salvage: it pulls surviving sheet data out of the broken container and rebuilds a workbook, reporting which sheets came back. Values and formulas recover best; formatting, charts, and macros are fragile.

Why does my downloaded Excel report not open?

Many web apps' 'Export to Excel' buttons don't produce real Excel files; they produce HTML or CSV named .xlsx. Excel notices the mismatch and refuses. The file isn't corrupted at all: rename it to .html or .csv and it opens, or re-export in a true xlsx format if the app offers one.

How can I tell if my Excel file is really an xlsx?

Check the first bytes. A real .xlsx starts with the letters PK (the ZIP signature) because an xlsx is a ZIP archive. The tool on this page reads those bytes locally and tells you what the file actually is: real xlsx, old-format .xls, HTML, CSV, or something else. (A fake xlsx opened in a text editor visibly starts with HTML tags.)

Related: workbook opens blank or loses sheets — repair Excel files · Archive won't extract — repair ZIP files (an .xlsx is a ZIP underneath)