GALAXY OF TOOLS

PDF SECTOR

Repair PDF

Recover damaged PDFs: rebuild broken cross-reference tables, fix truncated files and save every page that can be read.

Drop a damaged PDF here or click to choose Diagnosis and repair start straight away · nothing is uploaded

Your PDF is repaired inside this browser tab with qpdf (WebAssembly), pdf-lib and pdf.js, all downloaded from a CDN. The file is never uploaded.

Repair a damaged or corrupted PDF

“There was an error opening this document. The file is damaged and could not be repaired.” If you have seen that message, the Repair PDF tool gives the file a second chance. It diagnoses the damage, rebuilds the parts of the PDF structure that viewers rely on, and saves a working copy with every page it can recover.

Most broken PDFs are not destroyed — their content is still there, but the index that tells a reader where each object lives is wrong or missing. That happens when a download stops early, an email or FTP transfer alters binary bytes, an app crashes while saving, or a file is edited by a tool that writes bad offsets.

The repair runs entirely in your browser using three open-source engines — qpdf (as WebAssembly), pdf-lib and pdf.js — and the tool reports exactly which strategy worked and how many pages were recovered. Your file is never uploaded.

How to repair a PDF

  1. Drop the damaged PDF onto the upload area or click it to choose the file. The diagnosis starts immediately.
  2. Watch the repair log: each strategy is tried in turn and marked Worked, Partial, Failed or Skipped.
  3. Check the result: how the file was fixed, the number of pages recovered and the new file size.
  4. Press Download repaired PDF to save yourfile-repaired.pdf, then open it in your usual reader.
  5. If pages came back as images, use PDF OCR afterwards to make the text searchable again.

Repair PDF features

Structure check with qpdf

First, qpdf tries to read and rewrite the file as it is. A file that passes has no structural damage and is saved cleanly.

Cross-reference rebuild

The tool scans the raw bytes for every object, unpacks compressed object streams, fixes wrong stream lengths, drops truncated objects and writes a fresh cross-reference stream, then lets qpdf normalise the result.

Recovers missing catalogs

If the document catalog is lost, the page tree is located — or orphan pages are collected — and a new catalog is created.

pdf-lib fallback

A second, tolerant parser re-saves files whose objects are readable but out of order.

Page rescue as images

As a last resort, every page pdf.js can still draw is rendered into a new image-based PDF, so you keep what is visible.

Honest report

Each step shows what it found, and the result states how many pages were recovered — including when the file claims more pages than could be saved.

What actually breaks inside a PDF

A PDF is a collection of numbered objects — pages, fonts, images, content streams — plus a cross-reference table (or, in newer files, a cross-reference stream) that lists the byte offset of every object, and a trailer pointing to the document catalog. The file ends with startxref, the position of that table, and %%EOF.

If the end of the file is cut off, the reader cannot find the table. If bytes are added or removed anywhere — for example by a transfer in text mode that converts line endings — every offset after that point is wrong. In both cases the objects themselves are usually intact, which is why rebuilding the index from the objects recovers most files completely.

Which repair strategy does what

StrategyFixesResult
Structure check (qpdf)Files that are valid or only slightly irregularClean copy, nothing lost
Cross-reference rebuildWrong offsets, missing or cut-off xref and trailer, wrong stream lengths, lost catalogFull vector PDF with selectable text
Re-save with pdf-libReadable objects that the rebuild could not reassembleFull vector PDF
Rescue as imagesPages that only a viewer can still drawImage-only pages; use OCR for text

Limits and tips

  • Data that is truly missing — such as the second half of an interrupted download — cannot be rebuilt. Pages whose content was in the missing part are lost; the tool recovers the rest.
  • Password-protected PDFs must be unlocked first with Unlock PDF.
  • Repairing rewrites the file, so a digital signature in it will no longer validate.
  • After repairing, you can shrink the file with Compress PDF or restore searchable text with PDF OCR.
  • A “PDF” of 0 KB, or one that is really an HTML error page, contains no PDF data — download it again from the source.

Repair PDF FAQ

How do I repair a corrupted PDF for free?

Drop it into Repair PDF. The tool tries a qpdf structure check, a cross-reference rebuild, a pdf-lib re-save and finally an image rescue, then offers the best result as a download. There is no sign-up or limit.

Why does Adobe say my PDF is damaged and could not be repaired?

Usually the cross-reference table or trailer is broken or missing, often because the file was cut short during a download or altered during a transfer. Rebuilding the table from the objects in the file fixes most of these cases.

Will repairing recover all the pages?

If the page data is still in the file, yes — the result shows the number of pages recovered. Content that is physically missing from the file cannot be recreated.

Why are the recovered pages images?

That happens only when the last-resort strategy was needed: the pages could be drawn but not rebuilt as a PDF structure. The text is not selectable; run the file through PDF OCR to add a searchable text layer.

Is my file uploaded to a server?

No. qpdf, pdf-lib and pdf.js run inside your browser, and the PDF never leaves your device.

Can it fix a password-protected PDF?

Unlock it first with Unlock PDF using its password, then repair the unlocked copy. The tool cannot remove a password you don’t know.

You might also need