About the Repair PDF tool
A PDF that suddenly won't open, shows blank pages or triggers “the file is damaged and could not be repaired” is usually the victim of an interrupted download, a failed email attachment, a bad USB transfer or an app that crashed while saving. Often the page content is still inside the file, but the index that tells viewers where everything is — the cross-reference table — is broken or missing.
This repair tool first inspects the raw file and reports what it finds: whether the %PDF header is present (and whether junk bytes precede it), whether the end-of-file marker exists, and whether the cross-reference pointer is intact. It then opens the file with pdf.js, which can rebuild a broken index by scanning the whole file, and with pdf-lib in tolerant mode. If pdf-lib can reach the pages, it writes a completely fresh PDF with a new, valid structure, keeping text, images and links, and verifies that the result opens.
When the structure is too damaged for that but pdf.js can still display the pages, you can use the last-resort option: re-draw every readable page as an image into a new PDF. The pages look right but text is no longer selectable. Be aware that no tool can recover data that is truly missing, such as the second half of a truncated file, and encrypted files must be unlocked first.
How to use Repair PDF
- Drop the damaged PDF onto the upload box.
- Read the Diagnosis list: header, end-of-file marker, cross-reference pointer and what each engine could read.
- If a clean copy was rebuilt, click “Download repaired PDF” and check it in your viewer.
- If only pdf.js could read the pages, click “Re-draw pages as images” to create a viewable copy.
- Keep the original until you have confirmed the repaired file works.
Features
Structural diagnosis
Checks the PDF header, %%EOF marker and startxref pointer and explains what they mean.
Two independent engines
Uses both pdf.js (index reconstruction) and pdf-lib (tolerant parsing) to reach the pages.
Clean rebuild
Writes a fresh PDF with a new cross-reference table while keeping text, images and links.
Image fallback
As a last resort, renders every readable page into a new, valid PDF.
Self-check
The repaired output is re-opened to confirm it loads before you download it.
When to use it
- Recover an email attachment that says it is damaged when opened.
- Fix a PDF saved by an app that crashed or ran out of disk space.
- Rebuild a file that opens in one viewer but not another.
- Strip junk bytes that a faulty server added before the PDF header.
- Salvage the readable pages from a partially downloaded document.
Frequently asked questions
Can every corrupted PDF be repaired?
No. If parts of the file were never written or have been overwritten, that content is gone. The tool can rebuild the structure around whatever data still exists, and tells you when neither engine can recover any page.
Why would a repaired file have fewer pages?
If pages are missing from the file's page tree, pdf-lib can't reach them even though pdf.js sees them. The diagnosis tells you, and the image fallback may recover the extra pages.
Will the repaired PDF keep selectable text?
Yes, when the clean rebuild succeeds. Only the last-resort “Re-draw pages as images” option turns pages into pictures.
Can it repair a password-protected PDF?
No. Encrypted content can't be rebuilt without decrypting it first. Remove the password with Unlock PDF, then repair the unlocked copy.
Is the damaged file uploaded?
No. The diagnosis and repair run entirely in your browser.