How to Repair a Corrupted PDF — Three Real Recovery Paths
You double-click a PDF and the viewer says "file is damaged" or "cannot be opened" or just freezes. Maybe the file was interrupted mid-download, partially saved during a crash, or transferred over a flaky USB cable. Whatever the cause, the file is on disk and you need it back.
This guide walks through three real ways to repair a corrupted PDF — including the situations where no tool will help and what to do then.
What "Corrupted" Actually Means
A PDF is a structured file with three critical parts:
- Header: The first 8 bytes (
%PDF-1.x) tell viewers it is a PDF. - Body: The actual content — pages, fonts, images, vector data.
- Cross-reference table (xref): An index at the end of the file that tells the viewer where everything is stored.
"Corrupted" usually means one of three things:
- Truncated download — the file is missing the trailing bytes (xref table is gone).
- Bad bytes in the body — flipped bits from disk corruption or transfer error.
- Wrong file type entirely — what you have is actually HTML or a 404 error page renamed to .pdf.
Cases 1 and 2 are often recoverable. Case 3 is not — you need the original file.
Method 1: AllPDF.tools Repair (Browser-Based, Free)
The fastest no-install option:
- Open AllPDF.tools Repair in your browser.
- Drop your damaged PDF.
- The tool tries two passes: first a clean re-parse via pdf-lib (handles missing xref tables), then a page-by-page render via PDF.js to recover whatever pages are individually readable.
- Download the recovered PDF.
If even one page is salvageable, you get it back. Pages with too much corruption are skipped. Your file never leaves the browser.
Method 2: Adobe Acrobat Pro (If You Have It)
Acrobat Pro can sometimes open files that other viewers cannot. Open the file → if it loads at all → File → Save As → choose PDF. Acrobat rewrites the structure and produces a clean copy.
For badly damaged files, Acrobat has "Recover" mode (Tools → Print Production → Preflight → "Repair PDF document"). This is more aggressive than Save As.
Method 3: Ghostscript (Command Line, Free)
For Linux/Mac users comfortable with the terminal, Ghostscript can sometimes pull data from severely damaged PDFs:
gs -o repaired.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress damaged.pdf
This re-renders the PDF, which lets it skip damaged regions and recover what is readable. The downside: large files take time, and if the damage is in the header, Ghostscript will refuse to start.
Common Questions
Why does my PDF say "the file is damaged and cannot be repaired"?
That message comes from your viewer (Adobe Reader, Chrome, etc.) and is conservative — it does not actually try to repair anything. Run the file through one of the methods above before assuming it is unrecoverable.
Can I recover the file if it is encrypted AND corrupted?
Repair must happen before decryption. If the file is corrupted, repair it first; if recovery succeeds you can then attempt to remove the password with the original credentials.
How do I tell if my file is actually a PDF?
Open it in any text editor. The first line should start with %PDF-1. followed by a version number. If you see HTML tags, JSON, or random binary, it is not a PDF — likely a download error response saved with the wrong extension.
The repaired file is missing some pages — can I get those back?
If the source data for those pages is too damaged, no. But check if you have an earlier copy in your email, Drive, browser cache, or "Recently Deleted" folder. Sometimes the original is a click away.
Will the repaired PDF look identical to the original?
Usually yes for text and vector content. Embedded fonts and images come through intact. If the damage was in a specific image or font, that element may be missing or substituted.
Repair PDF — Free, In-Browser
Related guides: How to merge PDFs, How to flatten a PDF, How to compress a PDF.