How to Repair a Corrupted PDF File: 7 Free Methods That Work
You double-click a PDF and nothing happens. Or worse — you get an error message saying the file is damaged or corrupted. It's a sinking feeling, especially if that document contains important work, legal papers, or irreplaceable records. The good news? Most corrupted PDFs can be recovered. Here are 7 free methods that actually work, ranked from easiest to most technical.
Why Do PDF Files Get Corrupted?
Before jumping into fixes, it helps to understand what went wrong. PDF corruption usually happens for one of these reasons:
- Incomplete downloads — the file transfer was interrupted before finishing
- Storage device errors — bad sectors on a hard drive or failing USB drive
- Software crashes — the program writing the PDF crashed mid-save
- Email encoding issues — attachments sometimes get mangled during transit
- Malware or virus damage — malicious software altered the file structure
- Improper shutdown — turning off your computer while a PDF was being saved
Understanding the cause can help you pick the right repair method. A partially downloaded file, for example, might just need to be re-downloaded. But if the file itself is damaged on disk, you'll need one of the methods below.
Method 1: Try a Different PDF Reader
This sounds too simple, but it works surprisingly often. Different PDF readers handle file errors differently. Adobe Acrobat Reader is strict about file structure — if something is slightly off, it refuses to open the file. Other readers are more forgiving.
- Download an alternative PDF reader like Sumatra PDF, Foxit Reader, or MuPDF
- Try opening the corrupted file in the new reader
- If it opens, use "Save As" or "Print to PDF" to create a fresh copy
This method works because some readers can silently skip over corrupted sections and render whatever they can salvage. The resulting file is often a clean, working PDF.
Method 2: Restore from Previous Version or Backup
If you're on Windows, you might have a previous version of the file stored by the operating system:
- Right-click the corrupted PDF file in File Explorer
- Select "Restore previous versions"
- Look for an older version from before the corruption happened
- Copy the previous version to a new location and try opening it
On Mac, check Time Machine backups. Cloud storage services like Google Drive, Dropbox, and OneDrive also keep version histories — check the web interface for earlier file versions.
Method 3: Use an Online PDF Repair Tool
Several online tools specialize in repairing damaged PDF files. These work by analyzing the file structure and rebuilding the PDF from salvageable data:
- iLovePDF Repair — Upload your file and it attempts to fix structural issues
- PDF2Go Repair — Another solid option for fixing damaged headers and cross-references
- Sejda PDF Repair — Handles corruption in PDF objects and streams
Note: For sensitive documents, consider the privacy implications of uploading to a third-party server. If the PDF contains confidential information, try the offline methods first.
Method 4: Open and Re-Save in a Browser
Modern web browsers have built-in PDF viewers that can sometimes open files that dedicated PDF readers cannot. Chrome, Firefox, and Edge all have capable PDF engines:
- Drag and drop the corrupted PDF into a browser window
- If the browser can display it, press Ctrl+P (or Cmd+P on Mac)
- Choose "Save as PDF" as the printer destination
- Save the new PDF — this creates a fresh, clean file
This method essentially re-renders the visible content and creates a brand new PDF structure from scratch. It won't preserve interactive elements like form fields or bookmarks, but it recovers the visual content.
Method 5: Use Ghostscript to Rebuild the PDF
Ghostscript is a powerful, free command-line tool that can often repair PDFs when other methods fail. It reads the PDF at a low level and can re-encode it:
- Install Ghostscript from the official website or via your package manager
- Open a terminal or command prompt
- Run the command:
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=repaired.pdf corrupted.pdf - Check the resulting repaired.pdf file
Ghostscript works by interpreting the PDF content and writing it back out as a new, properly structured file. It can recover content from PDFs with broken cross-reference tables, damaged headers, or truncated file data.
Method 6: Use QPDF for Structural Repairs
QPDF is another free command-line tool that excels at fixing structural PDF problems. It can linearize, decrypt, and repair PDF files:
- Install QPDF from GitHub or your package manager
- Run:
qpdf --qdf --object-streams=disable corrupted.pdf repaired.pdf - If that fails, try:
qpdf --ignore-xref-streams corrupted.pdf repaired.pdf
QPDF is particularly good at handling PDFs with broken cross-reference streams, which is one of the most common types of corruption. The --ignore-xref-streams flag tells it to skip damaged sections and try to recover what it can.
Method 7: Extract Text and Rebuild
If the PDF is severely corrupted and none of the above methods work, your last resort is to extract whatever text content you can and rebuild the document:
- Try opening the file in a text editor — sometimes raw text is still readable
- Use a tool like
pdftotext(from poppler-utils) to extract any readable text - Check if any images can be salvaged using a hex editor or file carving tool
- Rebuild the document from the recovered content
This is the nuclear option, but it's better than losing everything. Even heavily corrupted files often have sections of readable text buried inside.
How to Prevent PDF Corruption
Prevention beats repair every time. Here are some habits that keep your PDFs safe:
- Always verify downloads — Check file sizes match what you expect after downloading
- Keep backups — Use cloud storage or regular backups for important documents
- Save before closing — Don't force-quit programs while they're saving PDFs
- Use reliable storage — Replace aging hard drives and USB sticks before they fail
- Compress before emailing — Large PDFs are more prone to corruption during email transfer
- Use "Save As" instead of "Save" — This writes a fresh file instead of modifying the existing one
Which Method Should You Try First?
Start with the easiest options and work your way down. Here's the recommended order:
- Try a different PDF reader (30 seconds)
- Check for previous versions or backups (1 minute)
- Open in a browser and re-save (2 minutes)
- Try an online repair tool (2-3 minutes)
- Use Ghostscript or QPDF (5-10 minutes)
- Extract text and rebuild (last resort)
Most corrupted PDFs can be recovered using one of the first three methods. The command-line tools are powerful but require more technical comfort. The key is not to panic — your data is usually still in there somewhere.
Need to work with PDFs?
Try PeacefulPDF's free online tools: