A damaged PDF often refuses to open, shows blank pages, or makes your reader offer to repair it. Repair PDF rebuilds the file's internal structure in your browser and gives you a new copy, while the original stays untouched. It is for files that are partly intact, not for pages that were never saved.
How to repair a damaged PDF
- Drop the file onto the tool or click Choose file. The tool checks the first 1 KB for a
%PDF-header, so a renamed image or text file is rejected before repair starts. - Check the filename and size, and keep the original file where it is.
- Click Repair PDF. QPDF, compiled to WebAssembly, scans the file and rebuilds its cross-reference table, trailer and object structure.
- If the rebuild succeeds, download
<name>-repaired.pdf. - Open the copy and check the pages, images, fonts and fields you need. Missing data was probably not in the damaged file.
What QPDF rebuilds
Most PDFs keep an index near the end called the cross-reference table. It records where each object begins; the trailer points to it and startxref gives its byte offset. If those offsets are wrong, the file can look corrupt even when most of its content is still there.
QPDF reads the objects it can find and writes a fresh cross-reference table, trailer and startxref. It rebuilds object streams and repairs missing or damaged cross-reference streams. Incorrect offsets, incomplete incremental updates and junk before the header are normal repair work. The output is a new PDF with a clean structure, not a patch applied to the old bytes.
This is a structural repair. QPDF does not redraw pages, and rebuilding the index cannot recreate an object that was cut off, overwritten or never written.
Common causes of damage
- An interrupted download. The cross-reference table and
startxreflive at the end of the file. An early stop can leave them missing. - An export that crashed. A program can write part of a PDF and stop before finishing the trailer.
- Disk errors or failing storage. Bad sectors or a power loss during a save can change bytes in the middle of the file.
- Software that edits PDFs badly. Some tools append changes and leave stale offsets, so a reader loads the wrong page or refuses the file.
- A partial restore. Restoring part of a file, or an incomplete backup, produces a truncated PDF.
A file may arrive damaged. If a colleague sends a PDF that already fails to open, ask for a fresh export.
What can and cannot be recovered
Repair often works when content is intact and only the file's navigation is broken. Typical successes include a bad cross-reference table, a missing startxref, a damaged trailer, a broken object stream, and inconsistencies from an interrupted edit.
Repair cannot create missing page content, images or fonts, or recover objects that were overwritten or never written. A severely truncated file may fail or rebuild with blank pages. Passwords are not recoverable; a password-protected file must be unlocked first. Repair is not a data-recovery service.
Some repairs produce warnings rather than a clean success. The download may work but have missing links, bookmarks, a substituted font or a form field that no longer responds. Check anything important.
Repair versus restoring from a backup
If you have the original file, a backup, an email attachment or a cloud version, restore it first. A fresh copy is more faithful than a rebuilt one and avoids losing objects QPDF had to drop.
Repair is most useful when no clean copy exists: a file recovered from an old drive, a deleted source, or an export that cannot be produced again. Treat the repaired file as a working copy and keep the original until you have checked it.
Repair changes the file's bytes, so digital signatures become invalid. Keep the signed original and ask the signer for a new copy.
Encrypted PDFs
QPDF cannot open an encrypted PDF that requires a password, and this tool has no password field. Open it in a reader you trust, or use Unlock PDF to save an unprotected copy. Repair that copy, and only unlock documents you own or may modify.
Unlocking and repairing are separate steps. Removing the password does not fix structural damage, and repair does not restore encryption. If the file is both encrypted and badly damaged, the reader may not save a clean copy; try another reader or a backup. The repaired download is not encrypted.
When to use Repair PDF
Try repair when a reader says the file is damaged, the page count looks wrong, pages are blank or missing after a download, or one reader opens the file while another rejects it. It is also worth trying on files from a failing disk.
Repair will not help with a wrong password, a file that is actually an image or Word document with a .pdf name, or content that was never included. A zero-byte file has nothing to rebuild. If every reader shows the same missing pages, the data is absent.
Privacy
The file is read with the browser's File API and rebuilt by QPDF WebAssembly in a worker on your device. Files never leave the browser: nothing is uploaded, and there is no account or server copy. The original stays untouched, and the repaired PDF stays in memory until you download it. Closing the tab discards it. The repair engine is a static asset.
Related PDF tools
- To remove a password first, use Unlock PDF.
- To make it smaller, use Compress PDF.
- To combine it with another file, use Merge PDF.
- To keep only the pages that survived, use Extract Pages from PDF.
Repair PDF FAQ
Can Repair PDF fix any damaged file?
No. It rebuilds the cross-reference table, object streams and other structural parts, but cannot recreate missing content. Files with large missing sections may not recover; use a backup or fresh export.
What happens to the original file?
Nothing. The tool reads a copy into browser memory and writes a new file. The original on your disk is not edited or uploaded.
Why does the repaired PDF have fewer pages?
QPDF can only write pages it can still find. If a page object was truncated or overwritten, the rebuilt file may leave it out. A lower count usually means the data was not recoverable.
Can I repair a password-protected PDF?
Not directly. The tool cannot ask QPDF for a password. Open the file in a PDF reader, save an unprotected copy, and repair that copy. Only unlock documents you own or may modify.
What does a QPDF warning mean?
QPDF may report that it reconstructed the cross-reference table or skipped an unreadable object. The file is usually usable, but check every page, image, font and link; a warning does not guarantee complete content.
Is the repaired file safe to open?
The repair does not add scripts or active content, but the PDF may still contain links, forms or JavaScript from its author. Open it with the same care as any PDF from that source. Repair is not a sanitiser.
Why is the download smaller or larger than the original?
A rebuild can drop unreachable objects and old incremental updates, making the file smaller, or expand compressed object streams, making it larger. Size alone does not show whether every page survived.
Can repair recover deleted pages or text?
No. Repair uses the bytes still present in the PDF. Deleted pages, redacted text and content that was never saved cannot be recovered unless another copy or backup exists.