How to Repair a Corrupted PDF File
What causes PDFs to become unreadable, and the fastest ways to recover them — in Acrobat, online, or via the command line.
Quick summary
Quick answer: PDF corruption usually happens when a file is partially written, truncated during download, or its cross-reference table is damaged. Adobe Acrobat can recover many damaged PDFs automatically when it opens them; for files Acrobat won't open, a dedicated repair tool (including free online options like Mapsoft's PDF Hub) can often rebuild the structure and recover the content.
You can also repair a PDF online for free using Mapsoft's PDF Hub — no installation required.
What causes a PDF to become corrupted
A PDF file isn't a flat stream of text. It's a structured container with a header, a sequence of numbered objects, a cross-reference (xref) table that records where each object lives in the file, and a trailer that points back to the xref. When any of those pieces is missing or inconsistent, a reader can't load the document and reports it as damaged.
The most common causes of corruption are straightforward:
- Interrupted downloads or transfers. If the connection drops part-way through, the file on disk is truncated and the trailer never makes it to your machine.
- Failed or incomplete saves. If Acrobat or another editor crashes mid-save, the resulting file may have a partial xref table or dangling object references.
- Storage errors. Bad sectors on a disk, a failing USB stick, or a sync conflict can silently flip bytes inside the file.
- Third-party tools that write non-conformant PDFs. Some batch generators emit PDFs that technically violate the ISO 32000 specification. Strict readers then refuse to open them even though nothing is physically damaged.
- Email filtering and antivirus tampering. Occasionally a mail gateway strips or rewrites portions of a PDF attachment in transit.
How do you know a PDF is corrupted?
The symptoms vary by reader, but the usual tells are:
- An error message on open, such as "There was an error opening this document. The file is damaged and could not be repaired." or "Insufficient data for an image".
- Pages render as blank or show garbled, overlapping, or missing text.
- The file opens but Acrobat silently recovers it, showing a banner like "This file was damaged and has been repaired."
- Acrobat crashes the moment the file is opened, or opens halfway and then hangs.
- Thumbnails fail to generate in the page panel.
Before assuming corruption, rule out the boring explanations. Try opening the file in a second reader (Adobe Acrobat Reader, a browser like Chrome or Firefox, macOS Preview). If it opens there, the problem is with the first application, not the PDF. If it fails everywhere — especially with the same error in each — the file itself is damaged.
Repair methods: from simple to thorough
There is no single repair procedure that works on every damaged PDF. The right tool depends on how badly the file is broken and what you have access to. Start with the least invasive option and escalate only if it fails.
Method 1 — Let Acrobat try automatic recovery
Adobe Acrobat and Acrobat Reader both include a silent repair pass that runs on open. If the xref table is missing or out of date, Acrobat will scan the file sequentially, rebuild the xref from scratch, and re-save the document. You don't need to enable anything — if the file is recoverable this way, Acrobat will simply open it and add a "This file was damaged" banner.
This handles the majority of "soft" corruptions (truncated downloads, old xref tables, linearisation damage). If Acrobat opens the file, immediately use File → Save As to write out a clean copy — don't keep working on the damaged original.
Method 2 — Repair online without installing anything
When Acrobat can't open the file, the next fastest option is a web-based repair tool. Mapsoft's Repair PDF runs the same class of rebuild Acrobat does — scanning the file byte-by-byte, reconstructing the object table, and re-writing a valid PDF — but in the browser, for free, with no installation. It's particularly useful when you're working on a locked-down machine where you can't install software, or when the damaged file came from an untrusted source and you'd rather not open it in your main reader.
Online repair can't fix content that's been physically overwritten (see When a PDF can't be repaired below), but it handles nearly every structural failure that causes a "damaged file" error.
Method 3 — Open the PDF in a different renderer
Different readers are more or less tolerant of spec violations. A PDF that Acrobat refuses to open might render perfectly in Chrome's built-in viewer, which uses PDFium, or in macOS Preview, which has its own engine. If it opens, print to PDF (File → Print → Save as PDF) to produce a fresh, clean file. You lose form fields, bookmarks, and interactive elements — but you keep the content.
Method 4 — Rebuild with a command-line tool
If you're comfortable at a terminal, two open-source utilities handle most structural damage:
qpdf --check input.pdfdiagnoses the file without modifying it.qpdf --linearize input.pdf output.pdfrebuilds the xref and emits a validated, optimised copy.pdftk input.pdf output output.pdfreads the document and writes a fresh copy, repairing many structural issues along the way.
Both tools are scriptable, which makes them useful if you have a batch of damaged files to process overnight rather than one file to fix once.
Method 5 — Recover from an older version
Before you fight the damaged file, check whether a clean copy exists elsewhere. Look in your email for the last version you sent or received, in cloud storage version history (OneDrive, Google Drive, Dropbox all keep previous versions), in your Downloads folder, or in a backup. A two-minute search often beats twenty minutes of repair work.
When a PDF can't be repaired
Repair tools rebuild the structure of a PDF — the index that tells a reader where each object lives in the file. They can't recreate content that's been overwritten or deleted. If the file was truncated mid-transfer and the last 40% of the bytes never arrived, no tool can invent the missing pages.
Signs that a file is probably unrecoverable:
- The file size is much smaller than it should be (e.g. 3 KB for what should be a 2 MB document).
- A hex dump shows the file ends abruptly, with no
%%EOFmarker near the end. - Multiple repair tools all fail with the same "no objects found" or "unexpected end of file" error.
- The storage medium it came from has known hardware damage.
If you hit this point, go back to the source — re-download the file, ask the sender to resend, or restore from a backup. In rare cases where the original generator is still available (e.g. the application that created the PDF is running on your machine), re-export from source is faster and cleaner than any repair.
Preventing PDF corruption
Most corruption is environmental. A few habits dramatically reduce how often you'll see it:
- Wait for downloads to finish before opening. Acrobat will happily open a half-downloaded file and misidentify it as corrupt.
- Save locally before editing. Editing a PDF directly on a network share or cloud-synced folder is an easy way to end up with a conflict-copy and a broken original.
- Use Save As, not Save, for final versions. Save As writes a fresh, fully re-serialised file; Save appends incremental updates that can accumulate errors over time.
- Keep your reader up to date. Both Acrobat and Acrobat Reader ship periodic fixes for corner-case handling of malformed files.
- Back up important documents. For any file you can't afford to lose, the single best defence is a copy somewhere else. Repair tools are second-best.
Frequently Asked Questions
What causes PDF corruption?
The most common causes are interrupted downloads, crashes during save, storage or network errors, and non-conformant PDF generators. Physical damage to the file bytes or a missing cross-reference table both produce the "damaged file" error.
Can every corrupted PDF be repaired?
No. Repair tools rebuild structural metadata but can't recreate content that was never written to disk or has been overwritten. Files that were truncated mid-transfer or saved to failing media often can't be fully recovered.
Is it safe to use an online PDF repair tool?
It depends on the tool. Reputable services like Mapsoft's PDF Hub process your file in the browser session, don't retain it beyond the repair, and run over HTTPS. For highly confidential documents, prefer a local tool or an internal enterprise repair service.
Will repairing a PDF change its content?
A clean repair should leave the visible content identical. Structural metadata (the xref table, linearisation hints, sometimes unused fonts) will be regenerated. Comments, form data, and bookmarks are preserved unless they were part of the damaged region.
Can I repair a PDF without Adobe Acrobat?
Yes. Free options include Chrome's PDF viewer (open and print to PDF), macOS Preview, online tools like Mapsoft's Repair PDF, and open-source utilities such as qpdf and pdftk. Acrobat has the most generous automatic recovery, but it's not the only option.
Related Articles
PDF File Structure Explained: Headers, Objects & Cross-Reference Tables
How PDF files are organised internally — the header, objects, xref table, and trailer that repair tools rebuild.
Understanding PDF File Size
Why PDFs get large, how compression works, and what's safe to strip out when you optimise or rebuild a file.
Optimising PDF Files for Web Delivery
Linearisation, image compression, and font subsetting — the other operations a repair pass often rolls into its output.