Repair PDF
Attempt to fix a corrupted PDF that will not open. The tool tries three repair strategies in order and shows a log of everything it attempted. All processing happens in your browser. Your files never upload anywhere.
Repair log
How the Repair Works
A PDF that will not open is usually not completely destroyed; one damaged part is blocking the reader from reaching the good content underneath. This tool tries three recovery strategies in order of quality, stopping at the first one that works, and logs every attempt so you can see exactly what happened.
Strip leading garbage. The tool scans the file for the first real %PDF- header and discards any junk bytes before it, such as byte-order marks or HTML from a failed download. Many broken downloads are fixed by this step alone.
Rebuild with pdf-lib. The cleaned file is loaded with pdf-lib and re-saved into a fresh document, which reconstructs the internal cross-reference tables. When this succeeds, you get a fully normal PDF with selectable text.
Raster rebuild with pdf.js. If the structure is too damaged, the more forgiving pdf.js parser renders each readable page to an image, and those images are placed into a brand new PDF. The pages look right, but text becomes unselectable pictures.
What Repair Can and Cannot Fix
Repair works best on files where the page content survived but the container is damaged: truncated downloads, bad headers, and broken cross-reference tables. It cannot recover content that is simply gone, such as a file cut off halfway through page 10, and it cannot open files encrypted with a real user password. Repaired files sometimes lose interactive features like form fields, bookmarks, and embedded attachments, because those live in the damaged structures that get rebuilt. Always compare the repaired file against the original page count and spot-check a few pages.
Why PDFs Get Corrupted
The most common cause is an interrupted download or email transfer that leaves extra bytes at the start or cuts the end off. Storage media errors, cloud sync conflicts that merge two versions of a file, and buggy PDF generators that write malformed structures are other frequent culprits. A telltale sign of a transfer problem is a file that opens on the sender computer but not after emailing; in that case ask for a fresh copy or a ZIP archive, which protects the bytes in transit far better than a repair attempt.
Tips for the Best Chance of Recovery
Work on a copy of the damaged file so the original stays untouched. If the file came from a download, try downloading it again first, ideally with a different browser, because a clean copy beats any repair. After a successful repair, open the result in two different PDF readers and check that the page count matches your expectation and that key pages render correctly. For valuable documents where every step fails, desktop tools like Ghostscript or mutool offer deeper recovery options than a browser can provide.
Frequently Asked Questions
What kinds of PDF damage can this tool fix?
The tool handles the most common recoverable problems. It strips junk bytes that some download managers or email systems prepend before the %PDF- header, which is a frequent cause of files that refuse to open. It then tries to re-save the document through pdf-lib, which rebuilds the internal cross-reference tables that readers depend on. If that fails, it falls back to reading the file with the more forgiving pdf.js parser and rebuilding the pages as images in a fresh document. Damage like a completely truncated file or a destroyed page tree may be beyond browser repair.
Why does my repaired PDF have unselectable text?
That happens when the tool had to use its last-resort rebuild. In that mode, each page is rendered to a picture and the pictures are placed into a brand new PDF, because the original text objects were too damaged to salvage. The pages look identical but the text is now pixels, so you cannot select, copy, or search it. If the first repair step succeeded instead, you get a fully normal PDF with selectable text. The log tells you exactly which path was taken, so you always know what you are downloading.
What does stripping leading garbage mean?
A valid PDF must begin with the marker %PDF- followed by a version number. Some files pick up extra bytes at the start: a UTF-8 byte-order mark, HTML from a failed download page, or email transfer artifacts. PDF readers see those bytes first and give up immediately, even though the actual document underneath is fine. The tool scans for the first real %PDF- marker and discards everything before it, which alone fixes a surprising number of broken downloads.
Are my files uploaded to a server?
Never. The repair runs completely in your browser using the pdf-lib and pdf.js JavaScript libraries. Your file is read into local memory and every repair attempt happens on your device. Nothing is transmitted anywhere, which is important because corrupted files are often sensitive documents you cannot afford to hand to a stranger. You can disconnect from the internet after the page loads and the repair will still run.
Can it repair a password-protected PDF?
Only partially. The tool attempts to open files with a blank password, which works for PDFs that merely restrict printing or editing. A file with a real user password that you do not know cannot be opened by this or any legitimate repair tool, because the content itself is encrypted. If you know the password, remove it first in a desktop PDF reader or with a dedicated unlock tool, then run the repaired file through this tool if it still misbehaves.
All three steps failed. What now?
First, check whether you have another copy: the original email attachment, a cloud backup, or the sender can often resend the file, and a fresh copy beats any repair. Second, try opening the file in several different readers, since some tolerate damage that others reject. Third, desktop tools like Ghostscript, mutool, or Adobe Acrobat have deeper repair options than a browser can offer. As a last resort for valuable documents, professional data recovery services can sometimes reconstruct files that automated tools cannot.