Understanding why JPEG files get corrupted is the first step to fixing them and, better still, to preventing the problem in the first place. A corrupted JPEG is not random bad luck; it is almost always the result of a specific, identifiable event that interrupted or altered the file's data. Once you know the usual culprits, the grey boxes and unopenable photos stop being mysterious. This guide breaks down the real causes, explains what each one does to the image, and points you toward a fix.

What Corruption Actually Does to a JPEG

To see why JPEG files get corrupted, it helps to picture how they are stored. A JPEG opens with a Start of Image (SOI) marker, follows with a header that describes the picture, then holds the scan data, which is the image itself compressed with Huffman coding and written from the top of the frame downward, and finally closes with an End of Image (EOI) marker. Corruption is any event that damages one of these parts: it can truncate the scan data, scramble the header, or wipe out the markers a decoder relies on to find its bearings.

The most common symptom, a photo that displays the top correctly and then dissolves into grey, comes from truncation. The decoder reads valid data down the frame until it hits the break, then has nothing left to draw. Knowing which cause you are dealing with tells you how much of the picture is likely to survive a repair.

Failing or Mishandled Memory Cards

SD and microSD cards are the single biggest source of corrupted photos. They are small, cheap, and endure constant reading and writing, which wears them down over time.

Cards Pulled Mid-Write

When you remove a card from a camera or reader while it is still saving, the write is cut off partway. The result is a truncated file: the top of the photo is intact, the bottom was never written, and you see the classic grey box. This is why ejecting safely matters so much.

Worn-Out or Counterfeit Cards

Flash memory has a finite number of write cycles. An aging card, or a fake high-capacity card that reports more space than it really has, starts returning bad data. Photos written to those failing regions come back scrambled or incomplete. If one card produces several corrupt files, treat it as failing and stop trusting it.

Interrupted Transfers and Downloads

A JPEG is only whole once every byte has arrived. Anything that stops a transfer before it finishes leaves a partial file.

  • Dropped downloads: a lost connection midway through downloading an image leaves the top portion saved and the rest missing.
  • Interrupted AirDrop or Bluetooth: moving the devices apart or cancelling mid-send produces a truncated file on the receiving end.
  • Unplugging during a copy: pulling a cable or drive while photos are still copying cuts off whichever file was in progress.

Interrupted transfers are frustrating but often the easiest to solve: if the original still exists, simply transfer it again. If it does not, the partial file can still be repaired to recover whatever arrived.

Bad Sectors and Failing Storage

Hard drives and SSDs develop bad sectors as they age, physical or logical regions that no longer hold data reliably. When part of a JPEG lands on a bad sector, reading it back returns garbage where clean image data used to be. This can scramble the header, break the scan data mid-frame, or corrupt the markers.

Failing storage tends to get worse, not better, so a photo that reads fine today may not tomorrow. If you suspect a drive is going bad, copy your irreplaceable files off it immediately, because every additional read on a dying disk risks further damage. Recovering the readable portion of an affected JPEG is often still possible with the repair JPG tool.

Editing and Application Crashes

Corruption does not only happen during transfer or storage; it can happen the moment a file is created or saved.

Crashes While Saving

If a photo editor, camera app, or phone crashes while it is writing a JPEG, the save is left incomplete. The file on disk has a valid start but no proper ending, and it may be missing its EOI marker entirely. These files frequently open partway and then fail.

Running Out of Storage

When a device runs out of space mid-save, there is nowhere to write the rest of the image. The result is the same as a crash: a truncated file with the top intact and the bottom absent. This is common on phones with full camera rolls.

Software Bugs and Format Confusion

Occasionally a buggy tool writes a malformed file, or an image is saved with the wrong extension, for example a HEIC or PNG renamed to .jpg. The data may be fine but mislabeled, which some viewers refuse to open. This is corruption in appearance only, and it is the easiest kind to resolve.

Why the Cause Determines the Cure

Each cause leaves a different fingerprint, and that fingerprint predicts how much you can recover:

  • Truncation (mid-write removal, dropped transfer, crash, full storage) keeps the top of the image and loses the bottom. Repair recovers the survived portion.
  • Header or marker damage (bad sectors, partial overwrites) often repairs almost fully, because the pixel data underneath is usually intact.
  • Wrong extension is not real damage; the file just needs to be recognized correctly.
  • Overwritten data is unrecoverable, because the original bytes are gone.

No repair can invent pixels that were never saved, but because JPEGs are written top-down, most real-world corruption costs you only the lower part of a picture while leaving the rest recoverable. For the exact steps, see our guide on how to repair a corrupted JPEG file, and for what partial recovery looks like, read recovering photos from a damaged JPEG.

Conclusion

JPEG files get corrupted for a small set of concrete reasons: failing or mishandled memory cards, interrupted transfers and downloads, bad sectors on aging storage, and crashes or full-storage events while saving. Each interrupts or alters the file's data at a specific point, and because a JPEG is written from the top down, the damage usually costs you the bottom of the image rather than all of it. That means most corrupted photos are worth trying to rescue. Once you have identified the cause, run the file through the repair JPG tool to recover what survived, and use our guide on preventing JPEG corruption to keep it from happening again.