How to repair a corrupt PDF
Start with one damaged .pdf file. Corrupt PDF Repair reads a copy in browser memory, checks its structure, and shows which pages pdf.js can render. When the file is unencrypted and pdf-lib can load it, the tool writes a new cross-reference table, trailer, and object offsets. You can then download the repaired copy and the diagnostic report.
- Drop a damaged PDF here, or click browse file.
- Review Diagnostic findings for header, EOF, cross-reference, object, trailer, stream, and encryption checks.
- Inspect Recoverable page preview and note any page tiles that failed to render.
- Click Download repaired PDF when a rebuild is available, then click Download diagnostic report to save the recorded findings.
What corrupt PDF repair checks
The raw scan checks the %PDF- header, extra bytes before it, the final %%EOF marker, and the startxref pointer. That pointer can lead to a classic cross-reference table or a compressed xref stream.
For a classic table, the tool samples offsets and checks whether they land on matching N G obj headers. It checks /Root and /Size in the trailer, compares /Size with the object headers it finds, and reports a stream without a later endstream.
An /Encrypt entry is reported separately. The page can show findings for an encrypted file, but it refuses to remove or bypass its protection.
How damaged PDF repair rebuilds a file
pdf.js receives the full byte array and tries to open it in recovery mode. It renders each page it can read. For an unencrypted document, pdf-lib loads the objects it can parse and saves a new file with fresh cross-reference data, a trailer, and object offsets. Missing or unreadable content is left out.
Input check
/Encrypt 7 0 R
Report
Encryption: Encrypted
Repair outcome: Not repaired
This report appears when the trailer data contains an /Encrypt entry. Raw checks still appear. pdf.js may preview pages if it opens the document without a password.
When corrupt PDF repair cannot produce a file
The rebuild stops when encryption is detected, the parser cannot load the document, or pdf-lib cannot save the parsed objects. The rebuilt file can also contain a different number of pages than pdf.js reports. Objects the rebuild engine cannot parse are omitted rather than recreated.
The drop zone accepts one document at a time. For files over 80 MB, the deep text scan reads only the first 80 MB. The header check reads the first 1,024 bytes, and the EOF check reads the last 2,048 bytes. Parser recovery and the repair attempt still use the full byte array. The preview is capped at 24 pages, and classic xref checking samples up to 500 entries.
Where corrupt PDF repair comes up
- A PDF opens with a cross-reference or object-offset error. Review the findings, then compare the rebuilt copy with the page preview.
- Only part of a damaged PDF opens. Check the page tiles to see which pages pdf.js rendered and which failed.
- A colleague or records team needs the repair attempt. Download the diagnostic report with the structural findings and parser recovery state.
When to use PDF Repair Tools
Use PDF Repair Tools to compare repair tools in this category. Use Corrupt PDF Repair for a damaged PDF when you need structural findings, page preview, and an attempted rebuild in the same result.
Frequently asked questions
How do I repair a corrupt PDF in my browser?
Drop a damaged PDF here or click browse file. Review the findings and preview, then use Download repaired PDF if the rebuild succeeds. The original file remains unchanged.
Can corrupt PDF repair fix a missing page?
No. The rebuild uses objects the parser can read, so it cannot recreate missing content. The preview shows pages that pdf.js rendered and marks page tiles that failed.
Can I repair an encrypted PDF?
No. An /Encrypt entry prevents the repair attempt. Raw checks still run, and pdf.js may provide a preview if the document opens without a password.
Does corrupt PDF repair upload the PDF?
No. The file is read into browser memory, scanned, previewed, and rebuilt there. The code sends no file to a server, and the source file remains unchanged.
How many pages can the PDF preview show?
The preview shows up to 24 pages. If the document declares more, the report notes that the preview was capped.