Repair PDF
Best-effort recovery of damaged PDFs — broken xref tables, truncated downloads, mangled headers. Runs entirely in your browser.
Select a damaged PDF
or drop one here — repair runs locally in your browser
—
Best-effort recovery. Not every PDF can be repaired — if the page content itself was destroyed, repair may produce a file that opens but is empty.
Repair report
- Recovery method—
- Pages before—
- Pages after—
- Size before—
- Size after—
Your file is ready
Processed entirely in your browser — the file never left your device.
How to repair a PDF
Three steps. The file never leaves your browser.
Open the damaged file
Pick or drop the PDF that won't open. It's read into your browser's memory only.
Run repair
We try the standard loader, then a tolerant loader, then rebuild the xref table from raw bytes.
Download the repaired copy
You get a fresh PDF — and a diagnostic report showing which recovery path worked.
How Repair PDF works
A PDF file is structurally three things: a header (%PDF-1.x),
a sequence of indirect objects (pages, fonts, content streams), and an
xref table at the end that says "object N lives at byte
offset X". When a PDF fails to open, almost always one of two things
has happened: the xref is wrong (truncated download, partial save,
offsets pointing at the wrong place), or one of the indirect objects
is mangled (bad compression, missing length, broken stream).
We try repair in three stages. Stage 1 is a strict load with pdf-lib —
that catches the easy case where the file is actually fine. Stage 2 is
a tolerant load: we ask pdf-lib (and the @cantoo/pdf-lib fork, which
has a slightly more permissive xref parser) to ignore individual
broken objects and keep going. Stage 3 is the last resort: we scan
the raw bytes for every N G obj … endobj block, build a
brand-new xref table that points at the ones we found, and try the
tolerant loader again on that synthesised file.
What this tool can fix
- Truncated downloads where the xref + trailer were lost off the end.
- Bad xref offsets — common with partial saves or incremental updates gone wrong.
- Garbage prepended to the front of the file (we re-locate the
%PDF-header). - Out-of-order objects after a third-party tool wrote the file incorrectly.
What this tool can't fix
- Encrypted files where the password is unknown. Repair fixes structure, not access. Use Unlock PDF instead.
- Mangled content streams. If the page's actual drawing instructions are corrupted, repair may produce a file that opens but renders blank.
- Files with no recoverable objects. If everything past the header is junk, there's nothing to reconstruct.
Privacy & security
Damaged PDFs are typically the result of something going wrong with an important file — a final contract that won't open, a tax document that Acrobat refuses to load, a downloaded statement that's mysteriously corrupt. Most online repair services upload your file to their server. Because this tool runs entirely in-browser there's no upload step at all, so even files with confidential content can be repaired without leaving your device.
Frequently asked questions
A PDF is a series of indirect objects (pages, fonts, streams) plus an "xref" table that indexes them. When a PDF gets corrupted, usually one of those two pieces is damaged — the objects are fine but the index is bad, or vice versa. We first try the standard PDF loaders. If they fail we walk the raw bytes, locate every object marker, and rebuild a fresh xref table that points at them. The output is then re-serialised with the most portable PDF settings (no object streams) so it opens in every reader.
No. The damaged PDF is parsed entirely inside your browser by pdf-lib and our byte-level repair routine. There is no server step, so even files with confidential content can be repaired safely.
Repair is best-effort. If the page content streams themselves are mangled, the file may load but render blank — that's data loss the tool cannot invent back. If the file has no recoverable indirect objects at all (everything has been overwritten or truncated past the first object) we throw a clear error rather than produce a fake result.
Not necessarily. The repaired file is usually similar in size to the original. If the original used object streams (a compression feature), the repaired copy may be slightly larger because we re-emit it without them for maximum compatibility.
Only the structural damage, not the password. If you have a corrupt + password-protected PDF, repair it first, then use our Unlock PDF tool with the correct password.