Repair PDF

Recover a damaged or corrupt PDF: qpdf rebuilds its structure and Ghostscript steps in when that is not enough.

loading Repair PDF
About this tool

How do you repair a corrupt PDF?

Repairing a PDF means rebuilding the parts of the file that a PDF reader needs to find its pages. A PDF ends with an index (the cross-reference table) that says where every page, font and image sits inside the file. When a download is cut short, an e-mail program mangles an attachment, a USB stick is removed too early or a program crashes while saving, that index is missing or wrong, and readers answer with "the file is damaged", "no pages" or a blank screen. Often the content is still there; only the index is broken.

You need this when a PDF will not open, opens with missing pages, shows an error such as "There was an error opening this document" or is rejected by a portal as invalid.

This tool works in two steps on our server. First qpdf rebuilds the structure and rewrites the file cleanly. If that is not enough, Ghostscript reads the page content again and writes a new file. The result is labelled when Ghostscript had to step in ("rebuilt by Ghostscript"). The file travels because a browser cannot repair a file it cannot parse. It is sent only when you press the button, processed in an isolated environment, and the original is deleted as soon as processing ends. The result stays available for 1 hour and leaves the server within 48 hours; the file name is never stored.

An honest limit: repair recovers what is still in the file. Data that was never saved, or the end of a truncated download, cannot be invented.

How to repair a damaged PDF

  1. Open the page. An example PDF is already loaded. Drag your damaged file anywhere on the page or press Choose a file. One file per run, up to 50 MB and 500 pages.
  2. Press Repair. The page shows each stage: checking, preparing the file, a quick check that you are not a robot, upload and processing with a timer.
  3. When it is done, press Download. The file keeps its name with -repaired added, for example thesis-repaired.pdf.
  4. Open the result and scroll through every page. Check the page count against what you expect.
  5. Once it opens, you can compress it, merge it with other files or split it.

Examples

A download that stopped halfway

invoice.pdf shows 0 KB of its expected 2.1 MB. If the file on disk is only part of the download, the end of the file is gone, including the page index. Repair may recover the first pages; the rest cannot be rebuilt. Download the file again from the source if you can.

A PDF whose index is wrong

report.pdf, 30 pages, opens in one reader and fails in another. The content is complete but the cross-reference table is damaged. qpdf rebuilds it and the repaired file has all 30 pages.

report.pdf (damaged index)  ->  report-repaired.pdf
Method: qpdf, structure rebuilt   Pages: 30

A file that needed Ghostscript

scan.pdf contains a page that qpdf cannot rebuild. Ghostscript reads what it can and writes a new document; the page says "rebuilt by Ghostscript". Because the file was rewritten, check text, links and any form fields afterwards: some interactive elements may not survive.

A file that is not a PDF

contract.pdf is really a renamed web page or a zero-filled file. The tool answers "Nothing could be recovered from this file: it is too damaged, or it is not a PDF". It never hands back an empty document pretending to be a repair: if the rebuild produces only blank pages, the job fails with that message instead.

Common errors and how to fix them

  • "Nothing could be recovered from this file: it is too damaged, or it is not a PDF.": look for another copy, an earlier version or a backup; download or receive the file again.
  • "The file is over the limit: up to 50 MB for PDF…": the limit is 50 MB. Try to recover with a desktop tool, or get a smaller copy.
  • "The document has more than 500 pages.": the tool refuses documents over 500 pages.
  • "Processing took too long and was stopped.": repair has a limit of 90 seconds; a very large, badly damaged file can exceed it.
  • "Your network reached the hourly job limit.": server tools allow 10 jobs per network per hour and 30 per day. Try again at the time shown.
  • A repaired file that still shows nothing: open it in another reader first; some viewers cache the broken file. If it is also blank in others, the content was lost.

Frequently asked questions

Can a corrupt PDF always be recovered?

No. If only the index is damaged, the repair usually works. If the page content itself is lost or the file was cut short, only what remains can be recovered, and sometimes nothing.

Why does my PDF say it is damaged but opens in another program?

Readers are tolerant to different degrees. One may rebuild the index silently while another gives up. Repairing the file writes a clean index so that every reader agrees.

Does repairing change my document?

With qpdf, pages, text and images stay as they are; only the file structure is rewritten. With the Ghostscript fallback the file is rewritten from the page content and interactive features may be lost; the page tells you when that happened.

Is it free and is it safe for confidential files?

It is free with no sign-up. The file is uploaded only when you press the button, the original is deleted right after processing and the result stays for 1 hour. If a document must never leave your device, do not use a server tool.

The PDF opens but is too heavy. What now?

Use Compress PDF. If it is password-protected and the repair fails, remove the password with Remove PDF password when you know it.

Does it work on a phone?

Yes: choose the PDF in your phone's files, wait for the stages and download the result.

Report a problem