JPEG, PNG, and HEIC fail in very different ways when a file is damaged. The search phrase jpeg vs png vs heic corruption is the angle missing from most format comparisons. Here is a plain, practical look at what actually survives when a file goes bad, and what that means for your archive.

How JPEG Handles Corruption

A baseline JPEG decodes top to bottom. If a file is truncated, the decoder still displays the upper part of the image. The lower part is simply missing. A partial JPEG is usually still usable, showing you most of the picture.

A progressive JPEG works differently. It stores the image in several passes. The first pass gives a blurry full image. Later passes add detail. If a progressive file is truncated, you may still get a complete but blurry version of the photo. That is useful for a preview, but the loss of detail matters for long-term storage.

JPEG is a lossy format. It throws away data during compression. That is fine for storage size, but the original data is gone before any damage happens. You are saving a compressed version that cannot be perfectly reconstructed.

How PNG Handles Corruption

PNG stores image data in chunks. Each chunk has a CRC-32 checksum that verifies its integrity. Strict PNG decoders reject the entire file if a single chunk fails its checksum. This is a double-edged sword.

The checksum detects damage early. A single bad byte can make the whole PNG unreadable. You get no partial image, unlike JPEG. Some lenient viewers may attempt to display what they can, but the specification says to reject the file.

PNG uses zlib compression, which is lossless. The file contains every pixel exactly as it was saved. If the file is intact, you get a perfect copy. If it is damaged, you often get nothing. For long-term storage, PNG is reliable only if you also have good backups.

How HEIC Handles Corruption

HEIC is based on the HEIF container, which follows the ISO base media file format. Images are stored as tiles, and the container holds an index that tells the decoder where each tile is located. If the index is damaged, the decoder may not find any tiles at all. The whole file becomes unreadable.

If the index survives but some tiles are lost, you might see a partial image with missing blocks. HEVC compression is lossy, like JPEG. The tile-based structure means damage can affect large areas unpredictably, depending on which tiles are missing.

HEIC files are more complex than JPEG or PNG. The container format adds dependencies that fail in multiple ways. For long-term storage, this complexity is a risk. If any part of the container structure is damaged, recovery is difficult.

Comparing Lossy and Lossless Trade-Offs

JPEG and HEIC are lossy. They discard data to reduce file size. PNG is lossless. It keeps every bit of the original image data. In terms of surviving damage, lossy formats have one advantage: they are designed to be decoded sequentially or in tiles, so partial data still produces something viewable. Lossless formats like PNG are stricter because they must reconstruct the exact original data.

For long-term storage, the choice between lossy and lossless is about priorities. If you want the highest quality, choose lossless, but protect against damage with backups. If you accept some quality loss, JPEG or HEIC gives you smaller files that survive partial damage better.

Which Format Is Most Reliable?

None of these formats is immune to data loss. The most reliable image format for storage is the one you back up. Any format loses data that was never written. If your file is damaged and you have no backup, the format only determines what you can salvage. JPEG gives you the best chance of seeing part of the image. PNG gives you a perfect image or nothing. HEIC gives you a complex structure that fails in multiple ways.

Practical Advice for Storing Photos

Keeping multiple copies matters far more than the choice of format. No format recovers data that was never saved. Take these steps to reduce the risk of image format data loss:

  1. Save original files in a lossless format like PNG if you want perfect quality. Accept that a damaged PNG may be unreadable.
  2. If you prefer smaller files, use JPEG. A truncated JPEG still shows the top part, which is better than nothing.
  3. Avoid HEIC for long-term storage unless you are certain you can handle the container complexity and have tools to recover from damage.
  4. Store at least two copies of your archive on separate media. One copy on a hard drive, another on cloud storage or an external disk.
  5. Check your archives periodically. Open a sample of files to confirm they are readable.

When you compare PNG vs JPEG damage, remember that a damaged PNG often gives you nothing, while a damaged JPEG may give you something. That does not make JPEG better overall. It just changes the failure mode. For the best photo format for storage, choose a format you can verify and back up.

What About HEIC?

HEIC files are efficient in size, but a damaged HEIC file is harder to recover from. The container index is critical. If that index is lost, the file may be unrecoverable even if the pixel data is still present. For long-term storage, simpler formats like JPEG or PNG are easier to work with.

How to Handle a Damaged File

If you have a damaged file, identify the format first. Then try viewing it in a few different applications. A lenient viewer can sometimes show part of a JPEG or even a PNG. For JPEG, open the file in a hex editor and truncate it to the last valid marker. This is a manual process and may not always work.

For PNG, if the CRC checksum fails, the file is technically invalid. Some tools attempt to skip bad chunks, but the result is unpredictable. For HEIC, the container structure is complex, and recovery usually requires specialized software.

If you need to recover a damaged JPEG, try jpeg.repair. It is a free online tool that attempts to recover damaged JPEG files without adding a watermark. No guarantees are made, but it is one option.