# Repair a damaged PDF

> A partial-recovery pass for damaged PDFs: re-parses the file with tolerant settings and re-saves a clean copy.

Open the tool: https://yourbrowsercandoit.com/repair-pdf

Try to recover a damaged or partially corrupt PDF. Free, no signup. Runs entirely in your browser; files are never uploaded.

## How it works

When a PDF won't open, the cause is usually a bad xref table, malformed objects, or a truncated download. The tool loads the file via pdf-lib with throwOnInvalidObject set to false and ignoreEncryption set to true, then re-saves with useObjectStreams: false (which writes a simpler, more compatible file structure). For files that are just slightly broken (often the case for downloads that failed mid-stream or PDFs generated by a buggy library), this is enough to get back a working document. For files that are genuinely destroyed (truncated to 10% of original, garbage content, etc.), the tool will fail with an honest error. Output filename has -repaired appended. The result may be larger than the input because object streams are unpacked.

## How to use it

1. **Drop the broken PDF.** Truncated downloads and files with bad xref tables are the best candidates.
2. **Run the repair.** The file is re-parsed locally with tolerant settings and rebuilt with a simpler structure.
3. **Download the repaired copy.** If the file was salvageable, the -repaired PDF downloads; truly destroyed files return an honest error.

## Frequently asked questions

### Can this recover any corrupt PDF?

No. It can fix files with minor structural issues (bad xref, malformed objects). Truly destroyed files (large truncations, corrupted page content) are beyond what client-side tools can do.

### Will the repaired PDF be the same as the original?

If the original was salvageable, the page content is preserved. The internal structure is rebuilt, so file size and object layout may differ.

### Is the file uploaded for repair?

No. Repair runs locally via pdf-lib in your browser.

### Why is the repaired file larger?

The repair re-saves without object streams (a compression scheme used by modern PDFs). Trading a bit of size for maximum compatibility.

## Related tools

- [Merge PDFs](https://yourbrowsercandoit.com/merge-pdf): Combine multiple PDFs into one file.
- [Split PDF](https://yourbrowsercandoit.com/split-pdf): Click between pages to cut, split every N pages, or pull pages out.
- [Compress PDF](https://yourbrowsercandoit.com/compress-pdf): Shrink a PDF or fit it under a size limit, and compare before saving.
- [Rotate pages](https://yourbrowsercandoit.com/rotate-pdf): Turn pages the right way up. Sideways pages are found for you.
- [Extract pages](https://yourbrowsercandoit.com/extract-pages): Pull pages out as a new PDF.
- [Watermark PDF](https://yourbrowsercandoit.com/watermark-pdf): Add text or a logo, placed and previewed on the real page.
