Repair PDF
Rebuild a broken PDF's internal structure with qpdf — and read the known fault below before you rely on it.
What this tool does
Repair PDF hands your document to qpdf, which reads it as forgivingly as it can and then writes a fresh copy from what it understood. When the cross-reference table is wrong, qpdf scans the file for object definitions and builds a new index from what it finds; stream lengths that disagree with the actual bytes are corrected, and a valid trailer is written at the end. Those are the faults behind most of the files a reader calls damaged.
One thing has to be said before any of that matters. qpdf signals a rebuild it had to improvise by exiting with a warning status rather than a clean one, and this service reads every non-zero exit as a failed job — so the repaired document qpdf has just written is discarded and you are shown "That PDF could not be processed." instead. The effect is backwards. A file whose cross-reference table is already sound passes through and is returned rewritten, while a broken startxref, shifted offsets, a truncated tail or a stream length that disagrees with the bytes present — the damage this tool is named for — ends the job with an error. That is a small change in the worker and it has not been made yet, so treat this as a tool for normalising files that still parse, and an unreliable one for the badly broken.
Nor can it conjure bytes that are not in the file. A download that stopped halfway, a copy off a failing disk, a save interrupted by a crash — in each case part of the document is simply absent, and rebuilding the index around the surviving objects is the most anyone can do. The work runs on the server: your PDF travels over an encrypted connection to a machine with qpdf installed, the upload is deleted the moment a job completes, and a sweep clears whatever is left — failed inputs and finished results alike — once the retention window passes. There is nothing to configure, because the cross-reference table is rebuilt on every write; hand it several PDFs and each one is sent as its own job and returned separately.
How to use it
- Add your PDFs. More than one is allowed — each becomes a separate job, within the 200 MB per-file upload ceiling. If a viewer asks for a password before showing an error, remove it with Unlock PDF first, because there is no password field here.
- Run the job. There are no options to weigh up. The same rebuilding pass runs every time, so the only variable is how much of your file survived.
- Read whatever comes back. A document qpdf parsed without complaint returns as your filename with -repaired appended. One it had to reconstruct ends in an error today, for the exit-status reason above — that error is a fault in this build, not a verdict on your file.
- Page through the result. Check the pages you care about before deleting the original, because a file that opens is not automatically a file that is complete.
Processing & privacy
Secure server processing. This operation requires temporary server processing.
Common use cases
A file that broke in transit
An upload cut short, a sync that half-finished or a copy off a dying USB stick leaves offsets pointing at the wrong bytes. Rebuilding the index around the objects that survived is the repair qpdf attempts, and it is also the case most likely to hit the error described above.
A reader that reports a damaged document
Messages about a corrupt PDF, a bad startxref or a file that could not be repaired all describe the same class of structural fault this rewrite addresses.
A PDF another service refuses to accept
Print shops, upload forms and converters are stricter than desktop viewers. Passing a still-readable file through qpdf normalises its structure, which often clears a rejection nothing else explained. This is the case that works dependably today.
A document produced by a rough generator
Scripts and older exporters emit PDFs that lenient readers tolerate and strict ones do not. One pass rewrites the file conventionally, provided qpdf can read it through without raising a warning.
Questions
Is my PDF uploaded?
Why did my corrupt file come back as an error?
What damage is it meant to fix?
My file opens now but pages are blank — what happened?
Why are there no settings?
Can it repair a password-protected PDF?
Does repairing change anything else in the document?
Will it make the file smaller?
Related tools
- Merge PDF — Combine several PDFs into one document in the order you choose.
- Split PDF — Split one PDF into separate documents by page range.
- Compress PDF — Reduce PDF file size while preserving the quality that matters.
- PDF to JPG — Export every page of a PDF as a JPG image.
- JPG to PDF — Turn one or many JPG photos into a single PDF.
- Protect PDF — Add a password and set permissions on a PDF.