How to repair a PDF that will not open
2026-11-29
There are three ways a PDF breaks, and they are not equally hopeless. Two of them usually give the document back intact; the third depends entirely on how much of the file you have.
"There was an error opening this document. The file is damaged and could not be repaired." It is a bad message to get about something you need, and it is more pessimistic than it sounds — plenty of files that produce it are substantially recoverable.
What matters is which kind of damage you have, because they are genuinely different problems.
A PDF is a pile of objects and a map
Everything in a PDF — each page, font, image, paragraph of text — is a numbered object. At the very end of the file sits a cross-reference table: a map saying object 47 begins at byte 180,402.
A reader opens a PDF by jumping to the end, reading the map, and using it to find the page you asked for. That design is why a 900-page document opens instantly.
It is also why PDFs break in exactly three ways.
The three kinds of damage
The map is wrong. Every object is present and perfect, but the offsets no longer match — something was appended, an editor wrote the file badly, a transfer altered line endings. The reader jumps to byte 180,402, finds something that is not object 47, and gives up. This is the most common failure and the most recoverable, because nothing is actually missing. The map can be rebuilt by reading the file from the top and noting where each object really starts.
Some objects are malformed. The map is fine but parts of the content are mangled — a stream with the wrong declared length, a broken dictionary, a bad image. A strict reader refuses the whole document over one bad object. A tolerant one skips it and keeps the rest. You usually lose something specific — one image, one page's formatting — and keep everything else.
The file is cut off. The download stopped, the drive filled, the transfer dropped. The beginning is intact and the end, where the map lives, does not exist. Nothing can jump to a map that was never written. But the objects at the start of the file are real, so the pages that arrived can often be collected and rebuilt into a working document — and the ones that did not arrive are not coming back.
What repairing actually does
Repair PDF works through those three in order, because each fallback is slower and loses more than the one before it.
- Rebuild the map. The file is read from the beginning, every object is found where it really is, and a correct cross-reference table is written. Nothing is lost. Most broken PDFs end here.
- Read around the damage. If that fails, the document is parsed object by object with invalid ones tolerated rather than fatal. Whatever is intact survives; the specific broken pieces do not.
- Scavenge the pages. If the document's root is gone — the usual outcome of a cut-off download — the file is scanned for anything that is a page, those pages are collected in order, and a new document is built around them. If the file stops mid-object, it is read up to the last complete one. The result tells you how many pages it recovered, which is the number that matters.
Pass three is salvage, not repair. Pages recovered this way can lose the things that lived in the document's structure — bookmarks, the table of contents, form fields, sometimes the page size, which falls back to a default. You get the content.
Before you decide it is broken
Two minutes of checking saves recovering something that was never damaged.
Try a different reader. Open it in a browser — drag the file into a new tab. Browsers are noticeably more forgiving than desktop readers, and a file that defeats one often opens in another. If it opens somewhere, print it to PDF from there and you have a clean copy.
Check the size. If you expected two megabytes and have 180 kilobytes, the file is truncated and the answer is to download it again, not to repair it. Compare against the source if you can.
Download it again, from the original source. Obvious, routinely skipped, and it fixes the most common cause outright.
Check it is actually a PDF. A file saved with the wrong extension, or an HTML error page saved as invoice.pdf, produces exactly this error. Open it in a text editor: a real PDF starts with %PDF-.
If it asks for a password, it is not damaged — it is encrypted. That is Unlock PDF, and it needs the password.
When the pages are gone but the words are not
If repair recovers less than you need, there is one more thing worth trying before giving up: the text may survive even when the pages do not. PDF to Text pulls out whatever text can still be read. For a contract or a report, the words are often the thing you actually needed, and getting them back unformatted beats not getting them back.
After a repair
Open every page. Repair gives back a file that opens; it cannot promise the content is complete, and a document that opens cleanly while missing page 14 is a trap.
Then save a fresh copy, and keep the damaged original until you are certain the new one is sound. If only some pages survived, Extract pages and Merge PDF will let you rebuild a set around them from other sources.
Making it less likely
Most damaged PDFs are made, not born.
- Let downloads finish, especially large ones on a connection that drops.
- Do not edit a PDF directly on a network drive or a memory stick. Copy it locally, work on it, copy it back. A write interrupted halfway is exactly case three.
- Do not keep the only copy anywhere. Repair is a second chance, not a guarantee, and there is no tool that recovers bytes that were never written.
The short version
- Try another reader first; browsers are forgiving.
- Check the size and re-download before assuming damage.
- A broken map is fully recoverable. Malformed objects cost you specific pieces. A truncated file costs you whatever never arrived.
- Repair tries all three, in that order, and tells you how many pages it saved.
- Check every page afterwards, not just the first.
- Keep the damaged original until the new one is proven.
See how much of it can be saved
Three recovery passes, strongest first, and a count of the pages that came back. It runs on your own device, so a file you cannot open is not also a file you have to upload.
Free, no account, no watermark — and the file never leaves your device.