Repair PDF

Find out why a PDF will not open, then rebuild whatever can still be recovered.

Repair reads and rewrites the file on your device. A damaged document is often the only copy you have, and nothing about it is uploaded.

Built and maintained by Udit Agarwal

Remove a password first

About Repair PDF

"The file is damaged and could not be repaired" tells you nothing about what went wrong. In practice a PDF that will not open is usually missing one of a handful of landmarks: the %PDF header a viewer checks first, the %%EOF marker at the end, the startxref pointer that says where the object table lives, or the trailer that names the document root. This tool reports each one individually, says whether the parser could still build a page tree, and then tries two repairs in order: copying the object graph into a fresh document, and — if that fails — redrawing every page the renderer can still paint.

Features

  • Checks the header, trailer, cross-reference pointer and end-of-file marker
  • Reports a startxref that points past the end of a truncated file
  • Detects encryption, which has to be cleared before objects can be rewritten
  • Trims junk prepended by mail gateways or appended after the last %%EOF
  • Rebuilds from the object graph first, keeping text, fonts and vector artwork
  • Falls back to redrawing each page when the object graph cannot be copied
  • Tells you which of the two repairs was used, and what it cost

How to use the Repair PDF

  1. Drop the PDF that will not open
  2. Read the structure check to see which landmark is missing
  3. Press Repair and let it try the object rebuild first
  4. Download the repaired file and open it to confirm

Example

Input

invoice-scan.pdf — downloaded over a dropped connection

Output

End-of-file marker missing; startxref points to byte 481,209 in a 402,880-byte file. Rebuilt: 6 pages recovered.

A cross-reference offset past the end of the file is the signature of a truncated download.

Common errors & troubleshooting

  • The repair produced a document with fewer pages than expected. — Only the pages whose objects survived can be recovered. A truncated file loses whatever came after the cut, and there is nothing left to rebuild from.
  • Repair reports the file is encrypted. — Objects cannot be rewritten without reading them. Remove the password first, then repair.
  • The repaired file lost its selectable text. — That means the object rebuild failed and the pages were redrawn instead. Recognise the text afterwards to make it searchable again.
  • Nothing could be recovered at all. — If not a single page renders, the damage reaches the page content itself. Re-download the original or restore it from a backup — no reconstruction can invent the missing bytes.

Frequently asked questions

What usually breaks a PDF?
An interrupted download or copy, which truncates the file, and email gateways that prepend or append text. Both are visible in the structure check as a missing marker or a bad offset.
Is my broken file uploaded to be repaired?
No. The bytes are inspected and the rebuild happens in this tab, so a damaged file containing sensitive material stays with you.
What does "fast web view" in the report mean?
The file was arranged so a browser can show page one before downloading the rest. Rebuilding drops that arrangement, which affects loading speed and nothing else.
Will the repaired file be identical to the original?
The pages will be. The object layout is rewritten, so the byte size and any linearisation change — that is what repair means.
Can this recover a PDF I deleted?
No. This works on a file you still have; recovering a deleted file is a job for disk recovery software.

Related tools

  • PDF Metadata Editor — View, edit or strip a PDF’s title, author, subject, keywords and producer.
  • Decrypt PDF — Remove password protection from an encrypted PDF.
  • Compress PDF — Shrink a PDF by re-rendering each page to a JPEG at a chosen quality and resolution.
  • Merge PDFs — Combine multiple PDFs into one, with reordering.
  • PDF to Images — Render PDF pages to PNG or JPG images you can download.
  • Flatten PDF — Lock filled form fields into the page so a PDF looks the same everywhere.
  • PDF OCR — Recognise the text in a scanned PDF and make it searchable.

Guides

More PDF tools

  • Edit PDF Text — Cover a mistake on a page and type the correction over it.
  • PDF Read Aloud — Listen to a PDF read out loud, passage by passage.
  • PDF Summarizer — Summarise a long PDF section by section, on your device.
  • Scan to PDF — Use a camera as a document scanner and save the pages as a PDF.
  • PDF OCR — Recognise the text in a scanned PDF and make it searchable.
  • Sign PDF — Draw a signature and place it on a PDF page, with an optional printed name and date.
  • Fill PDF Form — Type into a fillable PDF form, then save it filled or flattened.
  • Extract Images from PDF — Pull the embedded photos and logos out of a PDF at their stored resolution.
  • Bates Numbering — Stamp a continuous prefixed number across a set of PDFs and export the index.
  • Flip PDF Pages — Mirror PDF pages left to right or top to bottom, for transfers or a mirrored scan.
  • Split PDF by Size — Cut a PDF into parts that each stay under a file-size limit.
  • Split PDF Pages in Half — Turn scanned two-page spreads into single pages by cutting each sheet in half.

See all PDF tools (85) · All tools