RepairAnyFile
All supported formats
document.pdf

Repair Corrupted PDF Documents & Rebuild xref Tables

Trims leading garbage bytes before `%PDF-`, scans indirect objects to rebuild missing `xref` tables and `trailer` dictionaries, and restores missing `%%EOF` markers.

Select or drop PDF files

Accepts .pdf files (or any supported format). Runs 100% locally in your browser.

No PDF file handy? Try a broken sample:
0 bytes uploaded • Zero server storage

PDF Errors You Might See

  • "There was an error opening this document. The file is damaged and could not be repaired"
  • "Missing xref table" or "Root object is missing" in PDF readers
  • Truncated PDF download missing its `%%EOF` trailer

What We Repair Locally

  • Trims leading garbage bytes before the `%PDF-` header signature
  • Scans `N M obj` byte offsets and rebuilds missing `xref` + `trailer` + `startxref`
  • Appends missing `%%EOF` trailer markers on truncated PDFs
  • Streams large PDFs (>25 MB) for header/EOF patching without full-RAM copies

How PDF Repair Works

1

Locate %PDF- & Objects

Trims leading junk and indexes indirect `obj` byte offsets.

2

Rebuild xref & %%EOF

Generates a valid `xref` table, `/Root` trailer, and `%%EOF`.

3

Download Repaired PDF

Outputs a spec-compliant PDF without uploading sensitive documents.

What Cannot Be Repaired Automatically

Related PDF Error Guides

Other document Formats

Frequently Asked Questions

Are my PDFs sent to a cloud server?
No. Everything runs locally inside your browser Web Worker.
Can it fix a PDF missing its xref cross-reference table?
Yes. When the `xref` table is missing, RepairAnyFile scans all indirect PDF objects and `/Catalog` references to rebuild `xref`, `trailer`, and `startxref`.