How to Recover and Repair Corrupted PDF Files

Updated April 2026 • 8 min read

You try to open a PDF and get "The file is damaged and could not be repaired." Or it opens but shows blank pages, garbled text, or only partial content. PDF corruption happens more often than people think — and in many cases, the file can be recovered.

Here's how to fix corrupted PDFs using free tools, when recovery is possible, and how to prevent corruption in the first place.

Why PDFs Get Corrupted

  • Incomplete download: The transfer was interrupted before the file finished downloading. The PDF structure is incomplete.
  • Disk errors: Bad sectors on your hard drive can corrupt any file, including PDFs.
  • Improper save: The application crashed or the computer shut down while the PDF was being saved.
  • Email encoding issues: Some email systems mangle binary attachments, especially large PDFs.
  • Version mismatch: The PDF was created with features not supported by your reader's version.
  • Malware or disk corruption: File system corruption or malware can damage files.
  • Cloud sync conflicts: Dropbox, Google Drive, or OneDrive sync conflicts can leave corrupted files.

Quick Checks Before Repairing

Before trying repair tools, try these:

  1. Try a different PDF reader: What's "corrupted" in one reader might open fine in another. Try Adobe Acrobat Reader, Firefox, Chrome, or SumatraPDF.
  2. Re-download the file: If you downloaded it, download it again. The original might be fine.
  3. Check file size: If the file is 0 bytes or suspiciously small, the download failed. Re-download.
  4. Try opening in a browser: Chrome and Firefox have built-in PDF viewers that are more tolerant of certain errors.
  5. Restore from backup: Check if you have a previous version. Windows: right-click → Properties → Previous Versions. Mac: Time Machine.

Ready to try Compress PDF?

No uploads, no sign-ups. Everything happens in your browser.

Try Compress PDF Free →

Method 1: Ghostscript (Most Effective Free Tool)

Ghostscript can often recover PDFs that no other tool can. It reads the PDF content and re-renders it into a new, clean PDF file.

Basic repair command:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=repaired.pdf corrupted.pdf

Ghostscript will report errors but often still produces a valid output file. For more aggressive recovery:

gs -dNOPAUSE -dBATCH -dPDFSETTINGS=/prepress -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -sOutputFile=repaired.pdf corrupted.pdf

Install Ghostscript:

  • Windows: Download from ghostscript.com or winget install GhostScript.GhostScript
  • Mac: brew install ghostscript
  • Linux: sudo apt install ghostscript

Method 2: QPDF (Structure Repair)

QPDF specializes in PDF structure repair. It can fix broken cross-reference tables, corrupted streams, and other structural issues without re-rendering the content.

Basic repair:

qpdf --qdf --ignore-xref-streams corrupted.pdf repaired.pdf

For more aggressive recovery:

qpdf --qdf --suppress-recovery --ignore-xref-streams corrupted.pdf repaired.pdf

QPDF preserves the original content as much as possible — it only fixes the structural wrapper. This makes it ideal for cases where Ghostscript's re-rendering might lose quality.

Method 3: mutool (Lightweight Repair)

mutool is part of the MuPDF library and can clean and repair PDFs:

mutool clean corrupted.pdf repaired.pdf

Install: sudo apt install mupdf-tools (Linux) or brew install mupdf (Mac)

Method 4: Online PDF Repair Tools

If you don't want to use command-line tools:

  • PDF24 Tools (pdf24.org): Free, no file size limits, browser-based repair
  • iLovePDF Repair: Upload and repair, free for small files
  • Sejda PDF Repair: Free up to 200 pages, good recovery rate
  • PDFaid Repair: Another free online option

Privacy note: Uploading sensitive documents to online repair services means sending them to a third-party server. For confidential documents, use the desktop/command-line tools above.

Ready to try Merge PDF?

No uploads, no sign-ups. Everything happens in your browser.

Try Merge PDF Free →

Method 5: Adobe Acrobat Pro (Best Recovery Rate)

Acrobat Pro has the best built-in PDF repair engine. When you open a damaged file, it often automatically attempts recovery.

Manual repair:

  1. Open Acrobat Pro
  2. File → Open → select the corrupted PDF
  3. Acrobat will attempt to repair and display the file
  4. If it opens, immediately save it: File → Save As → give it a new name

You can also try: File → Save as Other → Optimized PDF, which can fix internal structure issues.

Recovering Text from Badly Corrupted PDFs

If the PDF can't be repaired into a valid document, you might still be able to extract the text content:

  1. strings command: strings corrupted.pdf | head -200 — extracts any readable text from the raw file
  2. pdftotext: Part of poppler-utils, sometimes extracts text from partially corrupted files: pdftotext corrupted.pdf output.txt
  3. Binary search: Open the PDF in a hex editor and search for text strings between stream markers
  4. Python with PyPDF2: Sometimes extracts text even from damaged files:python3 -c "import PyPDF2; r=PyPDF2.PdfReader('corrupted.pdf'); [print(p.extract_text()) for p in r.pages]"

When Recovery Isn't Possible

Some PDFs are too damaged to recover. This happens when:

  • The file is truncated (missing data at the end)
  • The content streams are encrypted and the key is lost
  • Large portions of the file have been overwritten with other data
  • The file was never a valid PDF to begin with (wrong extension)

In these cases, your best bet is to find the original source document and regenerate the PDF.

Preventing PDF Corruption

  1. Keep backups: Use cloud storage with version history (Google Drive, Dropbox) or local backups (Time Machine, File History)
  2. Verify downloads: Check file size after downloading. A partial download is the most common cause of corruption
  3. Save properly: Don't force-close applications while they're saving PDFs
  4. Use reliable storage: Replace aging hard drives. Run disk utility checks periodically
  5. Compress before emailing: Large PDFs are more likely to get corrupted in email transit. Zip them first
  6. Use PDF/A for archival: PDF/A is designed for long-term preservation and is more resistant to corruption

Which Tool Should You Try First?

  • First attempt: Try opening in a different reader or browser
  • Command-line repair: Ghostscript (most issues) or QPDF (structure issues)
  • GUI repair: Adobe Acrobat Pro
  • No-install repair: PDF24 Tools online
  • Last resort text extraction: pdftotext or strings command

Start with the simplest option and work your way up. In my experience, Ghostscript recovers roughly 70-80% of corrupted PDFs. QPDF handles another 10-15% that Ghostscript can't. The remaining cases usually need the original source document.