You open an important PDF — a contract, report, scanned documents or a thesis — and instead of pages you get: “There was an error opening this document. The file is damaged and could not be repaired.” Or it opens in a browser but not in Acrobat, printing stops halfway, some pages are blank. Annoying, but often not hopeless: in many cases the data is intact and only the file's “bookkeeping” part is broken, which can be rebuilt.
This guide explains why PDFs get corrupted, how a PDF is structured in plain words, how to repair a damaged PDF with our free Repair PDF tool, which alternatives exist and what to do if nothing works. We'll also be honest about when repair is impossible.
Quick answer: what to do when a PDF says the file is damaged
- Try opening the file in another app, such as a web browser.
- If that fails, upload the PDF to Repair PDF (up to 100 MB) and click the button.
- Download the rebuilt file and check that all pages are there.
- If pages are missing, find or re-download the original — lost data can't be recovered.
Free, no registration, no watermarks. Files are deleted from the server within 48 hours.
Why PDF files get corrupted
- Interrupted downloads. Unstable internet, a dropped connection, a sleeping laptop or a closed tab can leave only the beginning of the file on disk. It looks like a PDF, but the end, where key structural data lives, is missing.
- Failed copy or save. A USB drive pulled out without ejecting, a laptop shutting down mid-save, a full disk.
- Failing storage. Old flash drives, memory cards and hard disks with bad sectors corrupt parts of the data.
- Email attachments. Some mail systems and gateway scanners mis-encode or truncate attachments. Sometimes an HTML error page gets forwarded with a .pdf extension.
- Faulty generators. Home-grown reporting systems, old libraries and “free PDF editors” sometimes write structurally broken files. Lenient viewers open them; strict ones don't.
- Bad edits and sync conflicts. An editor crashing while saving, or cloud sync conflicts, can produce truncated or mixed-up files.
How a PDF works, in plain words
Header
The first line looks like %PDF-1.7. It tells software this is a PDF and which version. If you open the file in a text editor and don't see it at the top, it's probably not a PDF at all.
Body: objects
Most of the file is a set of numbered objects: pages, fonts, images, page content streams, bookmarks, metadata. Objects reference each other — the document catalog points to the page tree, each page to its fonts and images.
Cross-reference table (xref)
The file's index: for each object it records the byte offset where the object starts. Thanks to it, a viewer jumps straight to the page it needs. Modern PDFs may store this table compressed, as a cross-reference stream.
Trailer
The end of the file: a pointer to the root object, the position of the xref table (startxref) and the final %%EOF marker. Viewers start reading a PDF from the end — trailer first, then the xref table, then everything else.
The key insight: when a file is truncated, the trailer and xref table go first, and the viewer “doesn't know where to start” even though most page objects are still there. That is exactly what repair fixes: the tool scans the file, finds all surviving objects, rebuilds the cross-reference table and trailer, and writes a valid document.
| Situation | Chances of recovery |
|---|---|
| Broken or missing xref table or trailer | High — structure is rebuilt from the objects |
| Wrong offsets after a bad edit | High |
| File truncated halfway | Partial — pages whose data was written come back |
| Corrupted bytes inside an image or font | Partial — the page may show defects |
| Zero-byte file or file full of zeros | None — there is no data |
| Overwritten with other content, or not a PDF at all | None |
One-minute diagnosis
- Check the file size. Zero bytes, or a few kilobytes for a multi-page scan, means an incomplete download. Re-download it.
- Open it elsewhere. Chrome, Edge and Firefox are very tolerant and often open files Acrobat rejects.
- Look inside. In a text editor, the first line should start with
%PDF-. If you see<!DOCTYPE html>or<html>, it's a web page (often an error or login page), not a document. - Check for a password. Some apps report unsupported or failed decryption as corruption.
How to repair a PDF online, step by step
The Repair PDF tool uses Ghostscript, a proven PDF and PostScript engine that can read imperfect files. It re-reads the document, rebuilds the cross-reference table and structure, and writes a new PDF from everything it could read.
- Keep a copy of the original. The service doesn't touch your file, but an untouched copy lets you try other methods later.
- Open the tool page and drag the damaged PDF into the upload area. Limit: one file up to 100 MB.
- Click Repair PDF. The task runs in a background queue, usually from a few seconds to a couple of minutes.
- Download the result from the link.
- Check the document in the app that failed before: page count, images, tables.
If the file is password protected
An encrypted PDF can't be rebuilt without decrypting it. First remove the protection with Unlock PDF — you'll need the password — then run the repair. Afterwards you can protect it again.
After repair
The rebuilt file is a regular PDF. Shrink it with Compress PDF if needed, or save an archival copy as PDF/A.
Alternative ways to repair a PDF
Open in a browser and re-save
Browser PDF viewers rebuild structure on the fly. If the file opens, press Ctrl+P and choose Save as PDF. Pros: free and fast. Cons: the document is re-printed, losing links, bookmarks and forms; useless if the browser can't open it either.
Adobe Acrobat
Acrobat fixes minor errors automatically on opening and offers to save changes on close. If it says the file “could not be repaired”, its built-in recovery wasn't enough. Pros: familiar. Cons: no manual repair mode; stricter than browsers.
Command line: qpdf, Ghostscript, MuPDF
qpdf attempts xref reconstruction automatically:
qpdf damaged.pdf repaired.pdf
Ghostscript rewrites the document through pdfwrite — the same principle our tool uses:
gs -o repaired.pdf -sDEVICE=pdfwrite damaged.pdf
MuPDF's mutool can clean files too: mutool clean damaged.pdf repaired.pdf. Pros: free; trying several engines helps because each tolerates different errors. Cons: installation and terminal skills required.
Previous versions
Often the most reliable route is finding an intact copy: version history in Google Drive, OneDrive or Dropbox, Windows “Previous versions”, Time Machine on Mac, re-downloading the email attachment, or asking the sender.
Comparison
| Method | Rebuilds structure | Keeps links and bookmarks | Install | Cost |
|---|---|---|---|---|
| Our online tool | Yes, via Ghostscript | Partly | None | Free |
| Browser print to PDF | Only while reading | No | None | Free |
| Adobe Acrobat | Automatically, minor errors | Yes | Required | Reader free, Pro paid |
| qpdf, Ghostscript, mutool | Yes | Depends | Required | Free |
Common problems and fixes
The repaired file has fewer pages
Data for those pages is missing from the original, usually due to an interrupted download. The service keeps everything readable but can't create what isn't there. Re-download the original or ask the sender.
Some pages are blank or show grey boxes
The page object survived but its content or images are damaged. Try other engines (browser, qpdf, mutool) — sometimes one recovers a little more. For scans, rescanning may be quicker.
The service reports an error
The file may not be a PDF, may be empty or overwritten, or may be encrypted. Check the first line, the size and whether it has a password; for encrypted files, unlock first.
The digital signature is no longer valid
Repair rewrites the file, so a digital signature stops being valid. For legal documents, request a newly signed copy and use the repaired one for reading.
Preventing PDF corruption
- wait for downloads to finish and compare the file size with what you expect;
- eject USB drives safely and avoid unreliable media for important files;
- keep important documents in at least two places, ideally one with version history;
- use PDF/A for archiving;
- compress or split very large files before emailing so mail systems don't truncate them.
Security and privacy
- The file is uploaded only for repair and never published.
- Processing runs in a background queue; the result is available from a link.
- The original and repaired PDFs are deleted automatically within 48 hours.
- No registration is required, so files aren't tied to an account.
Frequently asked questions
How do I repair a corrupted PDF for free?
Upload it to Repair PDF and click the button. The service rebuilds the structure and returns everything it could read.
Why does my PDF say the file is damaged and could not be repaired?
Usually the cross-reference table or the end of the file is broken, for example after an interrupted download. The viewer can't locate the objects even though they may be intact.
Is recovery guaranteed?
No. Only what is physically left in the file can be recovered. Truncated, overwritten or empty data cannot be brought back.
Can I repair a password-protected PDF?
Remove the password first with Unlock PDF — you'll need the password — then run the repair.
Will the document change?
The file is rewritten, so size and internal structure may change and digital signatures become invalid. Visible content is kept as far as it is readable.
It opens in the browser but not in Acrobat. What now?
That's a classic sign of structural errors. Run it through repair — the rebuilt file usually opens everywhere.
Conclusion
A “file is damaged” error doesn't always mean the document is lost. Often only the PDF's bookkeeping structures — the xref table and trailer — are broken while the pages survive. Start simple: open the file in a browser and check its size. Then try rebuilding it. If the data is physically gone, look for the original in your email, cloud or backups.
Open Repair PDF, upload the damaged file and download the rebuilt document — free, with no registration and no watermarks.