Repair Guide

Fix Corrupted XLSX Files — Step-by-Step

An Excel file that won't open is a separate problem from an Excel file with a forgotten password. Corruption can come from many causes — incomplete saves, network transfer errors, broken zip headers, or actual data damage in the underlying XML. (Ransomware encryption is often mistaken for corruption: it is a separate encryption layer with its own recovery path, covered at the end of this guide.) This guide walks through diagnosing the corruption type and applying the right repair technique. Many corrupted .xlsx files still hold salvageable content — especially when the damage is in the XML rather than the container — if you don't make things worse first.

Step 1 — Always work on a copy

The most common mistake when dealing with corrupted Excel files is repairing in place. Make a backup copy first — recovery operations sometimes worsen the file (especially Excel's own 'open and repair' which can silently discard partial data).

Recommended: keep three versions of the file as you progress: original (untouched), working copy (where you try repairs), and any successfully recovered output. If a repair makes things worse, revert to original and try a different approach.

Backup discipline

Even read operations on a corrupted file can occasionally make it worse if Excel auto-saves a partial reconstruction. Work on copies, label clearly, never overwrite the original.

Step 2 — Diagnose the corruption type

XLSX files are ZIP archives with XML inside. The corruption type tells you which repair to attempt. Open the file with 7-Zip or any ZIP tool (rename to .zip if necessary). Three broad categories:

  • ZIP-level corruption: 7-Zip reports 'unexpected end of archive' or refuses to open. Likely incomplete download or transfer error.
  • XML-level corruption: 7-Zip opens fine but Excel reports 'unreadable content'. Some XML file inside is malformed.
  • Schema-level corruption: All files extract cleanly but Excel chokes on relationships or shared strings. The file is structurally complete but logically broken.

Step 3 — ZIP-level repair

If the file fails to open as a ZIP at all, the ZIP central directory is damaged — or the file is not a plain ZIP in the first place: a file-open-encrypted .xlsx is an OLE2 compound file, so a ZIP tool fails on it for a completely different reason. Rule that out before running any ZIP repair tool. Try: (a) zip -F file.xlsx --out repaired.xlsx (Info-ZIP's zip — package `zip` on Linux, preinstalled on macOS — fixes minor central-directory damage; use `zip -FF file.xlsx --out repaired.xlsx` when the directory is badly damaged or the file is truncated); (b) DiskInternals ZIP Repair, WinRAR's 'Repair Archive', or 7-Zip — note that 7-Zip's 'Test archive' only verifies CRCs and reports errors, but 7-Zip can often still open a damaged archive and extract the entries it can read via Extract with 'Keep broken files'; (c) for severe cases, rebuild the archive from its local file headers with Info-ZIP's `zip -FF` (free GUI equivalents: Ferro Backup ZIP Repair Tool, DataNumen Zip Repair).

An incomplete transfer cannot be rebuilt into a working workbook, so re-transfer from the source to get a complete file. But don't discard the partial file first: the bytes that did arrive can often still be salvaged by scanning local file headers with the ZIP-level techniques above, which do not depend on the central directory. Verify file size against expected size before attempting repair.

Step 4 — XML-level repair

If the ZIP opens fine but Excel reports unreadable content, the XML is malformed. The repair log Excel shows after opening usually indicates which file is the problem — 'Repaired Records: ...' lists the affected sheet or component.

Common XML corruption: stray null bytes, truncated end tags, invalid characters in strings. Open the affected XML file (e.g., xl/worksheets/sheet1.xml) in a text editor that handles UTF-8 cleanly. Look for unclosed tags or non-XML characters near the end of the file. Manual fixes are often viable for simple cases.

For complex cases, use a full XML validator (xmllint --noout file.xml) to identify exact errors. Frequently the fix is a single missing close tag, or an invalid/unescaped character inside a <t> or <v> element.

Step 5 — Schema-level repair

Files where every component is structurally valid but Excel still misbehaves are typically suffering from broken relationships (xl/_rels/workbook.xml.rels) or sharedStrings issues. These reference IDs that no longer exist in the file.

Symptoms: formulas break, or shared text strings are missing. The file is technically readable but logically inconsistent.

Repair: examine xl/_rels/workbook.xml.rels and xl/sharedStrings.xml. Cross-reference IDs against actual files. Remove orphan references or restore missing files from a backup.

Step 6 — When professional repair makes sense

Specialised repair tools (Stellar Repair for Excel, Recovery Toolbox for Excel) handle complex schema corruption automatically. They cost more than free tools and are aimed at cases where manual XML editing is impractical.

For files with high business value (financial models with hundreds of sheets, year-end accounts, audit-relevant records), the cost of professional repair is usually justified. Free DIY for one-off personal files; paid tools for irreplaceable business content.

Step 7 — Recover what you can

Sometimes full repair is impossible but partial recovery is. Strategies: (a) extract individual sheet XML files and import them into a fresh workbook; (b) parse cell values directly from sheet XML using Python (openpyxl in read-only mode) and reconstruct as a new workbook; (c) use LibreOffice Calc, which is more permissive than Excel for malformed files.

Partial recovery is better than zero recovery. Even a sheet without formatting or formulas often beats starting from scratch.

What happens with password-protected corrupted files

If the file is both encrypted (file-open password) and corrupted, repair must come before password recovery. The EncryptionInfo stream (and the EncryptedPackage stream) must be parseable to even attempt decryption.

If the EncryptionInfo stream can't be parsed, that's a structural repair problem first. Once the file is structurally valid (even if you can't read content), normal password recovery applies. This sequencing matters — don't try to crack a password on a file that won't even open as an OLE2 compound file.

5-step XLSX repair flow

  1. 1

    Copy the original

    Make at least 2 backup copies before any repair attempt.

  2. 2

    Open as ZIP

    Test with 7-Zip whether the ZIP container is intact.

  3. 3

    Identify problem level

    ZIP-level (unopenable), XML-level (Excel reports unreadable content), or schema-level (opens but logic broken).

  4. 4

    Apply matching repair

    ZIP repair tools, XML editor, or schema cross-reference. Match technique to corruption type.

  5. 5

    Verify and document

    Open the repaired file, verify expected content, document what was lost in case full recovery isn't possible.

Frequently Asked Questions

Will Excel's 'Open and Repair' damage my file?
It can. Excel's repair sometimes silently discards content it couldn't reconstruct. Always work on a copy and keep the original untouched in case repair makes things worse.
Can a corrupted .xlsx be password-recovered?
Only after structural repair. The EncryptionInfo stream must be parseable for any decryption attempt. Repair first, recovery second.
What about ransomware-encrypted .xlsx?
That's not corruption — it's a separate encryption layer applied by the malware. Repair tools won't help. Focus on the ransomware decryption path (specialist services, backup restoration).
How do I know if it's worth professional repair?
When the file's value to you clearly outweighs the cost of a repair licence and you cannot recreate it from another source, professional repair makes sense. Free DIY for personal files; paid for irreplaceable business content.
Is LibreOffice better at opening broken .xlsx?
Often yes. LibreOffice Calc is more permissive about malformed XML and recovers partial content where Excel refuses. Worth trying as a first step.
Can I prevent .xlsx corruption?
Best practices: keep files on stable storage (not USB sticks during writes), close cleanly before disconnecting, and keep regular backups. Note that AutoSave is not a corruption-prevention measure here — Excel auto-saving a partial reconstruction of a damaged file is one of the ways content is lost, which is why the repair steps above insist on working from copies.

Need Office password recovery?

Run a free analysis — encryption type detected automatically, fast techniques tried first, pay only on success.

Run Free Analysis

Related Reading