What this PDF repair tool does
Use this tool to inspect one .pdf document for structural damage. It runs byte-level checks, then uses pdf.js to test recovery and render pages. When an unencrypted file can be loaded, pdf-lib attempts a documented rebuild and the tool provides a repaired PDF plus the diagnostic report.
What the diagnostic report checks
- Header integrity - whether
%PDF-appears where a reader expects it, and whether stray bytes precede it. - End-of-file marker - whether the file ends with
%%EOFas expected, or looks truncated/appended to. - Cross-reference location and type - whether
startxrefpoints at a valid classic xref table or compressed xref stream. - Object offsets - for classic tables, whether each in-use entry's byte offset actually lands on a matching
N G objheader (sampled up to 500 entries). - Trailer keys - whether
/Rootand/Sizeare present so a reader can locate the document catalog. - Object-count consistency - whether the trailer's declared
/Sizematches the highest object number actually found in the file. - Truncated streams - whether the last object's data stream is missing its closing
endstream, a common sign of a cut-off download. - Encryption - whether an
/Encryptdictionary is present, reported for diagnosis only.
Recoverable page preview
Byte-level checks show structural problems, but the preview shows what pdf.js can actually read. The tool opens the file in recovery mode and renders recoverable pages, up to 24 pages. Pages that fail are shown as failed tiles. An encrypted PDF may still have a preview if pdf.js opens it without a password.
How the repair works
For an unencrypted file, the tool attempts to load and re-save it with pdf-lib. This creates a fresh cross-reference table, trailer, and object offsets from the objects the parser can read. Missing or unreadable content is not recreated. The report compares the rebuilt page count with the page count reported by the read-only parser.
When repair is unavailable
Repair is refused whenever an /Encrypt entry is detected. Raw structural checks still run, and page preview may still be available if pdf.js accepts the empty password; otherwise, only the raw checks are available. The tool never removes, bypasses, or guesses passwords.
If parsing or saving fails, no repaired file is offered. The rebuild cannot restore content that is missing or pages that pdf.js cannot open in recovery mode. The diagnostic report remains available to download.
How to repair a PDF
- Drop the damaged PDF onto the drop zone, or click browse file.
- Review Diagnostic findings.
- Inspect Recoverable page preview, including any failed-page tiles.
- When available, click Download repaired PDF. Click Download diagnostic report for the recorded results.
Privacy & limits
Scanning, previewing, and rebuilding happen locally in browser memory using pdf.js and pdf-lib. The source file is read once and is not modified or overwritten. Full-text structural scanning is capped at 80 MB; the header check uses the first 1,024 bytes and the %%EOF check uses the last 2,048 bytes. Parser-based processing and the repair attempt receive the full byte array. Page preview is capped at 24 pages.
Frequently asked questions
Can this tool fix any corrupted PDF?
No. It only fixes structural problems that a parser can actually work around, like a broken cross-reference table or bad object offsets, by rebuilding those from whatever objects it can still read. If the underlying content itself is destroyed or missing, this tool will not invent replacement content, and it will say clearly when a repair could not be produced.
Does it remove password protection or encryption?
No. Raw structural checks still run, and pdf.js may preview pages if it opens the file without a password. The tool never attempts to remove, bypass, or guess passwords, and it always refuses to produce a repaired file when an /Encrypt entry is detected.
Does it modify or overwrite my original file?
No. The source file is read once into browser memory and never written to. Any repair is written out as a brand new file you download separately - the original stays exactly as it was.
Does it upload my PDF anywhere?
No. Scanning, diagnosis, page preview, and repair all happen locally in your browser using pdf.js and pdf-lib. Nothing is sent to a server.