Repair a Corrupted PDF File That Will Not Open

Repairing a PDF means re-reading a damaged file with a tolerant parser that ignores a broken cross-reference table, locates the surviving objects directly, and writes them out as a fresh, well-formed file with a rebuilt xref and trailer. This tool performs that rebuild in your browser and returns the repaired copy. It can fix structural damage, but it cannot invent data - content whose bytes are missing or overwritten stays lost.

Repair PDF — runs on your device

How it works

A PDF is a random-access format. Readers do not scan it from the top; they jump to the end, read the startxref pointer and trailer, and use the cross-reference (xref) table to find every object — pages, fonts, images, streams — by its exact byte offset. This design makes large files fast to open, but it also concentrates fragility at the tail of the file. If the xref offsets are wrong, the trailer is mangled, or the final %%EOF marker is missing, a strict reader declares the whole file damaged even though the megabytes of object data above it are perfectly intact. Truncated downloads, FTP transfers in text mode, email gateways that touch line endings, and applications that crash mid-save all produce exactly this failure.

The repair works by refusing to trust that index. The tolerant parser reads the file front to back, recognizing obj … endobj boundaries directly in the byte stream, accepting off-by-a-few offsets, unbalanced dictionaries it can still make sense of, and other departures from the specification that strict readers reject. Every object it can positively identify is loaded into a fresh in-memory document.

Then comes the rewrite: the recovered objects are re-serialized into a brand-new file with correctly computed byte offsets, a clean xref table, a valid trailer, and a proper %%EOF. Nothing from the damaged scaffolding is copied over — the output's structure is generated from scratch, which is why a file that Adobe Reader refused to open can come out the other side opening everywhere.

Be clear about the limit: this is reconstruction of structure, not of data. If a download stopped at 60%, the last 40% of objects were never on your disk, and the rebuilt file will contain only what survived — possibly a document with fewer pages, or one where certain images are gone. No repair tool, local or cloud, can restore bytes that do not exist; anything claiming otherwise is guessing. Everything here runs in your browser's memory, so the broken file is never uploaded anywhere.

Worked example: an invoice mangled by an email gateway

A 14-page supplier invoice bundle, 2.6 MB, arrived through an old mail system that converted line endings in attachments. Acrobat reported "There was a problem reading this document (14)"; the file's startxref offset pointed 27 bytes past the real xref table because stray carriage returns had shifted every offset in the file.

Dropped onto this tool, the tolerant parse identified all 312 objects by scanning for their obj markers rather than trusting the shifted offsets — every page, font, and image stream was intact. The rewrite produced a 2.5 MB file (slightly smaller: one orphaned duplicate object from an earlier incremental save was dropped) with a correct xref. Total time in-browser: about four seconds, and the repaired invoice opened cleanly in Acrobat, Preview, and Chrome. Had the same file instead been cut off at 1.3 MB mid-download, only the objects in the surviving half could have been saved.

Frequently asked questions

Why does my PDF say the file is damaged and cannot be repaired?

Strict readers give up when the cross-reference table, trailer, or end-of-file marker is wrong, which is the most common form of PDF corruption. A tolerant parser can often still find the objects and rebuild the index. Run the file through this tool and it will produce a fresh, well-formed copy if the object data survives.

What actually corrupts PDF files?

The usual causes are interrupted downloads or copies that truncate the end of the file, transfer modes or gateways that alter binary bytes, crashed applications leaving half-written incremental saves, and failing storage media. Most of these damage the file's tail, where the xref table and trailer live.

Can a repair tool recover pages missing from a truncated PDF?

No. If the download stopped early, the bytes for the later pages were never written to disk, and no software can reconstruct data that does not exist. Repair restores access to the objects that are present; re-download or restore from backup for the rest.

Is it safe to repair a confidential PDF online?

With this page, yes, because the file is parsed and rewritten by JavaScript running in your own browser and never uploaded. Cloud repair services, by contrast, receive the full document on their servers. Local processing removes that exposure entirely.

Why is the repaired PDF a different size from the original?

The rebuild writes a single clean revision of the document, discarding duplicated objects from incremental saves, unreferenced data, and damaged fragments the parser skipped. The output is often smaller, and a small size change is normal and harmless.

Can this fix a PDF that asks for a password?

No. A password prompt means the file is encrypted, not damaged, and its contents cannot be parsed without the key derived from the password. Repair only helps files whose structure is broken.

Related tools