How to repair a PDF online
- Drop your damaged PDF into the tool above, or click to browse your device.
- The repair process starts automatically — watch the progress bar as your file is rebuilt.
- Download the repaired PDF instantly. Everything runs in your browser — nothing is uploaded.
How PDFly repairs your PDF
PDF corruption happens in many ways — an interrupted download, a failed email attachment, or a software crash while saving. The most common failure is a broken cross-reference table, which tells a PDF reader where to find each page and object in the file.
PDFly's Repair tool works in two stages to recover as much content as possible:
- Stage 1 — Structural rebuild: Using the pdf-lib library, the tool scans the file and rebuilds a clean cross-reference table. This fixes PDFs that won't open due to a broken file structure. Fonts, images, and text are preserved exactly as they were.
- Stage 2 — Page-by-page recovery: If the structural rebuild fails, PDFly falls back to a more aggressive approach. It renders each page using pdf.js and recreates the document as a fresh PDF. This can recover content even when the file structure is too damaged to rebuild, but it converts pages to images, so text may no longer be selectable.
Both stages run entirely in your browser — no file data ever leaves your device.
What causes PDF corruption?
- Interrupted downloads or transfers: The file was only partially saved, leaving the cross-reference table incomplete.
- Software crashes: The application saving the PDF crashed before the file structure was fully written.
- Email attachment corruption: Some email clients or servers can corrupt PDFs during transmission.
- Storage errors: Bad sectors on a hard drive or USB stick can damage file integrity.
- Overly aggressive compression: Some third-party tools produce malformed PDFs that don't follow the spec correctly.
What kinds of PDF damage can be fixed?
- Broken cross-reference tables: The most common issue — fixed by Stage 1 (structural rebuild).
- Missing or damaged page objects: If a page can still be rendered, Stage 2 can recover it as an image.
- Invalid object references: The tool rebuilds the object table and discards unreachable data.
What can't be fixed?
- Completely missing data: If the file was truncated (cut off mid-way), there's no data to recover beyond the point where the file ends.
- Encrypted PDFs without the password: Repair can't decrypt protected files. Use Unlock PDF first if you know the password.
- Zero-byte files: If the file size is 0 bytes, there's no data to repair.
Before you repair: quick wins
- Try opening in another reader: Preview on Mac or Google Chrome's built-in PDF viewer can sometimes handle files that Adobe Acrobat won't open.
- Check the file size: If the file is 0 bytes or very small (under 5KB), the file is likely empty and can't be repaired.
- Get a fresh copy: If the file came from an email or download, try re-downloading it from the original source.
Common mistakes
- Expecting a 0-byte or truncated file to be fully recoverable — missing data can't be recreated.
- Trying to repair a password-protected PDF without unlocking it first.
- Deleting the original file before checking that the repaired version opens correctly.
- Using the tool on files that aren't actually PDFs (rename errors won't be fixed).
Troubleshooting
- The repair says "Couldn't repair this file": The file is too damaged for PDFly to recover any page data. Try re-downloading the file from the original source if possible.
- The repaired PDF is missing some content: Pages that couldn't be rendered in Stage 2 are skipped. The tool recovers as many pages as it can.
- The repaired PDF is much larger than the original: In Stage 2 recovery, pages are saved as images (JPG), which can increase file size. If you need a smaller file, use Compress PDF after repair.
- Text isn't selectable in the repaired PDF: This happens when Stage 2 recovery was used — the content was recovered as images, not text. If selectable text is critical, try opening the original in a different PDF reader first.