Repair a PDF that won’t open
Rebuild a damaged PDF in your browser, with a plain report of what was wrong and what was fixed.
or drop it here · it never leaves your device
Processed in your browser. Your files are never uploaded. Check it yourself
How to repair a PDF that won’t open
A PDF can fail to open for many reasons: a download that stopped early, an email attachment that was cut off, a save interrupted by a crash, a file copied from a failing drive. Readers respond in different ways. Some show an error, some a blank page, some open only part of the document.
Repair re-reads every part of the file it can find, rebuilds the index and the list of pages, and writes a fresh file. It is a good fit when the structure is broken but the content is still there. It cannot invent content that was never saved, and the report tells you plainly when pages could not be recovered. There is a fuller guide to fixing a PDF that won’t open.
- 1
Choose the damaged file
Press Choose a PDF or drop the file on the panel. Unlike most tools here, this one accepts files that other tools refuse, because the point is to cope with files that are not quite PDFs. It also accepts the generic file type some email programs give to downloads.
A short “What we can see so far” panel appears with up to three checks: whether your browser can open the file (and if so how many pages it counts), whether a PDF header is found at the start, and whether the file’s index of objects looks intact or needs rebuilding. These are readings, not repairs, and nothing has changed yet.
- 2
Press Repair PDF
There are no settings. The engine tries the gentlest fixes first and rebuilds only what is broken, so a file with a single bad pointer is not needlessly reconstructed. A progress bar shows while the work runs, and the Cancel button stops it without changing anything.
If the file asks for a password, you will be told to remove it with Unlock PDF first. Repair does not handle encrypted files and never guesses passwords.
- 3
Read the report before you trust the file
The report opens with the headline figure, such as “Recovered 10 of 12 pages”, and says whether the file opened before. Below it each problem the engine found is listed as Fixed or Not fixable. A “Rebuilt” line names the structures that were reconstructed, for example the cross-reference table or the page tree, and a “Lost” line says what could not be recovered, such as “Pages 11 to 12 (file ends early)”.
If anything was lost, the card is titled “Repaired, with some loss” and carries a warning to check the result before relying on it. A preview of the first page of the new file sits at the bottom so you can see straight away whether it looks right.
- 4
Download and keep the original
The download is named yourfile-repaired.pdf. Your original is only read, never changed, so keep it: a better repair tool, or a fresh download from the sender, may do more with it later. From the result card you can go on to compress, merge or reorganise the pages.
Repair PDF features
- Rebuilds the cross-reference table, page list and document catalogue
- Recovers the pages that are still readable
- Reports each problem found and whether it was fixed
- Says which pages or images could not be recovered
- Shows a preview of the repaired first page
- Never changes your original file
Repairing a PDF without uploading it
Your file is read into this browser tab and repaired by code running on your device. It is not uploaded, and a damaged file is never sent anywhere to be fixed.
A PDF is a set of numbered objects plus an index (the cross-reference table) that says where each one is. Most breakage is in the index or the end of the file, and objects can often be found again by scanning. The repair scans the whole file, rebuilds the index, reconstructs the page tree and catalogue, and writes a new, complete file.
- Truncated files lose their ending. If a download stopped at 60%, whatever was in the missing 40% is not in the file. Pages from that part can’t be recovered.
- Corrupted streams inside an image or font may leave one picture or some text unreadable while the rest recovers.
- Passwords: an encrypted file needs Unlock PDF first. Repair does not guess passwords.
- Your original is untouched. The repaired file is a new download.
How to prove your file never left your device: a two-minute Network-tab and offline test you can run on this tool.
A report that stopped downloading halfway
A 12-page annual report opens in your reader with the error “There was an error processing a page” and shows nothing past page 10. Drop it into Repair PDF. Your browser can’t open it either, and the file ends early.
Press Repair PDF. The report says the cross-reference table was rebuilt and 10 of 12 pages were recovered. Pages 11 and 12 are listed as lost because the file ends before them. Download report-repaired.pdf, check the preview, and ask the sender for a fresh copy of the last two pages.
Good to know
- If you still have the original download link, try downloading again before you repair. A fresh copy beats a rebuilt one.
- Try the file in a different reader first. Browsers and desktop readers are strict in different ways.
- After repair, save a fresh copy by printing to PDF. It tidies anything that is still unusual.
- Repaired files can be larger or smaller than the original. Run them through Compress PDF if size matters.
How a PDF is built, and where it breaks
A PDF file has four parts, and most damage is to the last two.
- A header. A first line such as
%PDF-1.7that identifies the file and its version. The specification lets a reader look for it within the first kilobyte, so a few stray bytes before it are survivable. - A body of numbered objects. Each looks like
12 0 obj ... endobjand holds a page, a font, an image or a content stream. Newer files pack many small objects inside compressed object streams to save space. - A cross-reference table. An index giving the byte position of every object. Newer files store this as a compressed stream instead of a plain table. It lets a reader jump straight to page 80 without reading the first 79.
- A trailer. A final dictionary naming the root of the document, the file’s object count and the position of the index, followed by
startxrefand%%EOF.
A reader opens a PDF from the end: it finds startxref, follows it to the index, then loads the root. Cut off the last few kilobytes and the reader has no starting point, even though 99 per cent of the objects are intact. That is why a file that stopped downloading near the end can fail completely.
Repair does what a forgiving reader does, but it does it on purpose and saves the answer. It scans the whole file for object markers, rebuilds the index from what it finds, reconstructs the list of pages and the document root, and writes a new, complete file whose index is correct.
Common reasons a PDF stops opening
- An interrupted download or a stopped transfer. The file is a prefix of the real one. This is the single most common cause, and the lost pages are genuinely not in the file.
- A save cut short. A crash, a flat battery or an unplugged drive during a write leaves a file with no trailer.
- Text-mode transfers. Old FTP programs, some mail gateways and some copy-and-paste routes convert line endings in what they believe to be text. In a binary format that changes bytes and shifts every position in the index. Reader messages vary, but “file is damaged” is typical.
- Failing storage. A bad block can corrupt a stream in the middle of the file. The rest may be fine.
- Buggy generators. Some scripts and exporters write an index with the wrong byte positions or an incorrect object count. Strict readers refuse them while forgiving ones quietly rebuild the index.
- Extra bytes at the front. A web server error message or an HTTP header stored before the file can push everything off by a fixed amount.
- A file that is not a PDF. A Word document, an HTML error page or a zip file renamed to end in .pdf.
The first and last of these tell you something useful: if the damage is truncation, repair will recover what remains; if the file was never a PDF, nothing can be recovered, and the tool says so.
Why one program opens the file and another refuses
Readers have different tolerance for broken structure. Some, on finding the index wrong, rebuild it in memory without telling you. Browsers’ built-in viewers are often forgiving and usually show what they can. Desktop readers may show a “repairing” message and then open a partial document, or refuse. Printing software and online converters are frequently the strictest, which is why a file that you can read on screen may be rejected by a court e-filing system or a printer’s upload portal.
That gap is the main reason to repair a file that already opens. A forgiving reader hides the damage from you, but the next program in the chain may not. The first row of this tool’s pre-check tells you whether your browser can open the file; the third tells you whether the engine believes the index needs rebuilding. If the browser opens it but the index is flagged, repairing is worth doing.
What you may see in a reader that cannot cope varies with the program. Typical wordings are “There was an error processing a page”, “The file is damaged and could not be repaired”, “Failed to load PDF document” and, in some browser viewers, “Invalid PDF structure”. All of them mean the same thing: the structure the reader expects is not there.
When Repair is the right tool, and when it is not
Good fits
- A file that opens in a browser but fails in your print shop’s portal or an e-filing system.
- A download that finished but whose reader complains about the structure.
- A file recovered from a failing disk or an old backup, where you want every readable page.
- A file from a script or a scanner that generates slightly invalid PDFs.
- A file with missing or corrupt pages in the middle that you want to save the remainder of.
Not what repair is for
- A file with a password you do not know. Nothing here recovers passwords.
- A file that is just too big. That is a job for Compress PDF.
- A scan that is unreadable because the picture is bad. Repair mends structure, not image quality.
- A file whose text is garbled but which opens normally. That is a font problem; OCR PDF or PDF to text can show what the text really contains.
Three worked examples with numbers
The numbers are round figures to show the reasoning, not measurements from a test run.
A 48 MB report that stopped at 31 MB
A 60-page report is meant to be 48 MB, but your download is 31 MB, about 65 per cent. Pre-check says the browser cannot open it and the index needs rebuilding. Repair reports about 38 of 60 pages recovered, with the rest listed under “Lost: file ends early”. The sensible next step is to download the file again from the source, not to rely on 38 pages. Keep the repaired file as a stopgap, and note that linearised files (built so the first page loads early) often leave their opening pages readable when truncated.
A 3 MB invoice that prints but will not upload
An accounts portal rejects a 3 MB invoice with “invalid file”. Your browser opens it fine. The pre-check says the browser opens it and the index needs rebuilding. Repair reports an index fixed and 2 of 2 pages recovered, nothing lost. The new file uploads without complaint, because its index now matches the data.
A 10-page file with one corrupt image
Page 7 shows a blank rectangle where a chart should be. Repair reports 10 of 10 pages recovered, one stream not fixable, and lists the damaged image. The page text and layout survive, and the chart is the part you need to replace from the original source.
What repair cannot do, and how to read the limits
- It cannot invent missing data. If the end of a file is gone, the pages stored there are gone. The “Lost” line in the report names them.
- A partial recovery is still a recovery. Even when pages are lost, the recovered ones are written into a clean file. Check the preview and page count before you send it on.
- Encrypted files are out of scope. An encrypted file whose structure is damaged needs unlocking first, and if the damage is inside the encrypted data, it cannot be rebuilt.
- Digital signatures will not survive. A signature covers specific bytes, and a repaired file has different ones. Treat the repaired copy as unsigned.
- Bookmarks and links may be affected. They point to pages by reference. If the page tree needed reconstructing, check them.
- Forms and fonts. Form fields are separate objects and often recover well. A damaged embedded font can make text look wrong on one page even though the rest is fine.
- Size can change. The new file is rewritten, so it may be a little larger or smaller than the damaged one.
- The report is about structure. It does not read your content, so a clean report does not prove the pages say what they should.
If this tool says the file cannot be rebuilt, that usually means too little readable structure is left. Look for another copy before giving up: the original attachment in your email, an earlier download, a backup, or the sender’s cloud storage.
Privacy: damaged files are often the ones you least want to send away
Online repair services ask you to upload the broken file, and it is not unusual for the file in question to be a contract, a medical letter or a scan of ID. Here the file is read into the memory of your browser tab and repaired by code that is running on your own computer. It is not sent to a server, and the report shows only structural facts, such as which index was rebuilt, not the content of your pages.
You can confirm this with the browser’s Network tab, or by going offline once the page has loaded. The verification guide gives the steps.
Repair PDF: troubleshooting
- “That file isn’t a PDF”
- The file does not start with PDF data. Renaming a document to .pdf does not convert it. If the file came from a download, look at its first few bytes in a text editor: an HTML error page or a zip header explains it.
- “We couldn’t rebuild this file”
- Not enough readable structure remains. Try the original download, a backup or an earlier email attachment. If the file is an old scan, the sender may have another copy.
- “This PDF needs a password”
- Remove the password with Unlock PDF using the password you know, then repair the result.
- The report says “Repaired, with some loss”
- Some pages or objects could not be recovered. Read the “Lost” lines, check the page count against what you expected, and ask for a fresh copy of the lost pages.
- The preview of the repaired file is blank
- The first page may be one of the damaged ones. Open the downloaded file in a reader and look at the other pages; if they are fine, Organize pages can drop the empty page.
- The repaired file still will not open in my program
- Try it in a second reader to see whether the program is the problem. If it is a strict one, printing to PDF from a browser viewer produces a simpler file.
- Text looks wrong on some pages after repair
- A damaged embedded font or stream was recovered only in part. Compare with the original, and use PDF to text to see whether the text itself is intact.
- The repaired file is much smaller than the original
- Pages may have been lost; check the page count in the report. A smaller size on its own, with all pages recovered, is normal when old revisions or unused objects are not carried over.
- The tab stopped responding on a very large file
- Repair has to read the whole file into memory. Close other tabs or try a computer with more memory. For a file over a few hundred megabytes, desktop tools may be better.
Glossary
- Cross-reference table
- The index in a PDF that gives each object’s byte position, so a reader can jump straight to a page.
- Trailer
- The closing dictionary that names the document root and where the index starts. Readers open a file from here.
- Object
- A numbered unit inside a PDF: a page, font, image, content stream or dictionary.
- Page tree
- The structure that lists the document’s pages in order. A broken tree can hide intact pages.
- Truncation
- A file that ends early, usually because a download or save was interrupted.
- Linearised PDF
- A file built so the first page can display before the whole file arrives. Also called fast web view.
- Object stream
- A compressed container that packs many small objects into one, used by newer PDFs.
- Stream
- A block of data, often compressed, holding page content, an image or a font.
Related tools and guides
Repair PDF: frequently asked questions
What kinds of damage can it fix?
Missing or wrong cross-reference tables, broken trailers, a damaged page tree or catalogue, and files with extra bytes before the header. It can often recover the readable pages from a file that ends early.
Will I get every page back?
Not always. If the file was cut short, or a page’s own data is corrupted, those pages can’t be recovered. The report lists what was lost, so you know what to ask the sender for.
Does it change my original file?
No. Your original is only read. The repaired copy is a new file you download.
My PDF asks for a password. Can you repair it?
Remove the password first with Unlock PDF using the password you know, then repair the result. We never guess or crack passwords.
Is my damaged file uploaded?
No. Repair runs entirely in your browser. You can check yourself that nothing is sent.
Why does the file open in one reader but not another?
Readers differ in how forgiving they are. A forgiving one may rebuild the index silently while a strict one stops. Repairing writes a correct index, so the file opens in more places.
Will it fix a PDF that is really a different file type?
No. A Word document or a zip file renamed to .pdf is not a PDF. If the file has no PDF content at all, the report will say that nothing could be recovered.
Can it repair a form or a signed PDF?
It can rebuild the structure, but rebuilding a signed file changes the bytes the signature covers, so the signature may no longer validate. Treat the repaired copy as unsigned.
How do I know whether a file needs repair?
Open it in your browser first. The tool’s pre-check also says whether your browser can open it and whether the file’s index looks intact. If a strict program such as a printer portal rejects a file that your browser opens, repair is worth trying.
Why is a file that stopped downloading still partly readable?
The pages are stored in the body of the file, and only the index at the end is missing. Repair rebuilds an index from the objects it finds, so every page that arrived in full can be recovered.
Does repair fix scanned pages that look dark or crooked?
No. It mends the file’s structure, not the content. Use Rotate PDF for sideways pages, or rescan.
Should I repair every PDF I receive?
No. Only repair files that fail to open, show errors, or are rejected by another system. A file that opens and prints correctly everywhere does not need it.
Page updated · By the PDFMagpie team