How to repair corrupted JPEG photos on Mac
JPEG is the most common photo format in the world, which means it's also the format people most often recover and most often find broken. You pull a batch of photos off a formatted SD card or a failing drive, and some of them won't open at all, while others show that unmistakable symptom of a damaged JPEG: the top half of the image is fine and the bottom half is a flat band of gray or garbled color.
The good news is that a broken JPEG usually still contains most of its image data. What's broken is the structure that tells software how to decode it. This guide explains how JPEGs corrupt, why a recovered one often won't open, and how repair turns it back into a usable photo.
How a JPEG breaks
A JPEG is more structured than it looks. It opens with a start-of-image marker (the SOI), followed by headers that describe the image's dimensions, color information, and the Huffman tables the decoder needs. After that comes the compressed scan data — the actual encoded pixels. A decoder reads these parts in order, and if any of them is missing or wrong, it can't proceed.
A missing or garbled header is the most disabling kind of damage. If the SOI marker or the header that follows it is gone — overwritten, or lost when the file was carved from raw disk blocks — software opens the file, finds no valid JPEG structure where it expects one, and refuses to display anything. You get an error or a broken-image icon even though the encoded pixels below are intact.
Broken scan data produces the gray-half image. When the headers are fine but the compressed pixel data is truncated or corrupted partway through, the decoder renders correctly up to the point of damage and then has nothing valid to read. It fills the rest with gray. That visible boundary between good and bad is the exact byte where the file's data stopped being readable — often because that's where it was overwritten or hit a bad sector.
Truncation is common with interrupted writes. A camera or app that stopped writing a JPEG before it finished — a dead battery, a yanked card, a crash — leaves a file that simply ends early, missing its closing marker and some of its scan data.
Why a recovered JPEG won't open
When you recover a JPEG from a damaged drive, especially with a deep scan that carves files directly from raw disk blocks, the recovery tool copies out the bytes it believes belong to the file. If part of that range was overwritten, or the file was fragmented and the pieces were stitched imperfectly, or the header landed in a damaged sector, the recovered file carries that damage with it.
This is the broader pattern behind every unreadable recovered file — covered in why recovered files won't open. Recovery answers "where are the bytes?" It does not answer "do these bytes form a valid JPEG?" A recovery-only tool hands you the bytes and stops. The photo is mostly there; the structure that makes it a photo is broken.
What repair does to a JPEG
Repair rebuilds the JPEG's structure and salvages everything decodable. DataRecover Pro identifies the file as a JPEG, then reconstructs the parts a decoder needs: rewriting a valid SOI marker and header, restoring or substituting the tables required to decode the scan data, and re-establishing the structure around the compressed pixels so a standard image viewer can read them.
This follows the same three-tier model the repair engine uses for every format, explained in the complete file-repair guide. Clean repair fixes minor header or marker damage with no loss — the full image comes back. Structural repair rebuilds the framing around intact scan data. When a JPEG is only partly recoverable — the classic case where the bottom of the image was overwritten — partial repair salvages the decodable portion and produces a valid file that opens and shows what survived.
That last point is worth being clear about: partial repair on a JPEG means a usable if imperfect image. If half the scan data is genuinely gone, repair cannot invent the missing pixels — but it can give you a photo that opens and displays the top half cleanly, instead of a file that opens to nothing. For a photo you can't reshoot, half the picture is worth a great deal more than an error message.
Because repairing a malformed image means parsing untrusted data, every repair runs in a sandboxed worker process with no network access and no ability to write elsewhere on your Mac. A corrupted JPEG, however badly broken, can't harm anything.
How to repair JPEG photos with DataRecover Pro
If the photos are lost or deleted, recover them first. Run a deep scan of the card or drive; it carves JPEGs by their signature even after a format, and routes corrupted results through the repair engine automatically, so you receive a repaired photo rather than broken bytes. If a JPEG is already on your Mac but won't open, you can point DataRecover Pro at it directly.
Preview before saving. DataRecover Pro shows a thumbnail and macOS Quick Look of the repaired image, plus a confidence score that tells you whether you're getting a clean rebuild or a partial salvage. Use it to confirm the photo is worth keeping — scanning and preview are free and require no account.
Save the repaired photos to a different drive than the one you recovered from. Writing them back onto the source risks overwriting other photos you haven't recovered yet.
Want to fix your own broken JPEGs? Download DataRecover Pro and scan for free, or read the repair overview for how the engine works.
How to avoid corrupting JPEGs
Most JPEG corruption happens at write time. Eject SD cards and readers properly so writes finish before the card disconnects. Don't shoot on a nearly full card, and replace aging cards every few years — wear is a real cause of bad blocks. When you copy photos off a card, verify the copy completed before you reformat in-camera, and ideally offload to two places. If you also shoot RAW, the same care applies — see repair corrupted RAW photos on Mac. And keep your photo library backed up, because repair is a rescue, not a backup.
Lost a file? Get it back.
Scan and preview for free. See what's recoverable before you buy.
Coming soon