Recover Corrupted CR2 Files from SD Card
In this article
Yes, you can recover corrupted CR2 files from an SD card, and the success rate depends on the cause of the corruption and how quickly you act. This article explains what CR2 corruption looks like, why it happens, and the practical steps you can take to get your photos back.
What Is a CR2 File and Why Do They Corrupt?
CR2 is Canon's raw image format, a container that holds the unprocessed sensor data from Canon DSLR and mirrorless cameras. Unlike JPEG, a CR2 file is not a single block of compressed data; it contains a header, image data, metadata, and often an embedded JPEG preview. Because of this structure, a CR2 file can become partially unreadable while still showing a preview in some software.
Corruption on an SD card usually happens in one of three ways:
- Logical corruption: The file system (FAT32 or exFAT) loses track of where file data begins or ends, often after an improper ejection or a card that was used across devices.
- Physical damage: A damaged card can produce read errors that manifest as corrupted files, even if the underlying data is intact.
- Incomplete writes: If the camera loses power or the card is removed while writing, the file may be truncated or left without a proper end marker.
The most common symptom is a file that won't open in Photoshop or Lightroom, but shows a thumbnail in Windows Explorer or macOS Finder. That preview is the embedded JPEG, which is often saved separately from the raw data and can survive even when the raw portion is damaged.
First Steps: Stop Using the Card Immediately
The single most important rule in data recovery is to stop writing to the card as soon as you notice a problem. Every new photo, file deletion, or even a format operation can overwrite the sectors that contain your lost images. If you are shooting on a second card, switch to it. If not, turn the camera off and remove the card.
Do not run a disk check or repair utility on the card itself. Tools like chkdsk on Windows or fsck on macOS can attempt to fix the file system, but they may also write changes that reduce the chance of recovery. The same applies to formatting the card in-camera as a quick fix—it almost always makes the situation worse.
Instead, connect the card to a computer using a card reader and make a full disk image (a byte-for-byte copy) using free tools like dd on Linux or macOS, or Win32 Disk Imager on Windows. Work on the image file, not the original card, so you can try multiple recovery methods without risking further damage.
Recovery Software That Can Handle CR2
Not all recovery tools understand raw formats. Some only scan for common file signatures (like JPEG or PNG), which may miss CR2 files because their header is different. Look for software that explicitly lists CR2 support, or that allows you to add a custom file signature.
Popular options include:
- PhotoRec – free, open-source, and supports many raw formats including CR2. It scans by signature and can recover files even when the file system is damaged.
- Recuva – free for basic use, works well on intact file systems, but may not handle severely corrupted cards.
- R-Studio – paid, but offers advanced raw recovery and can reconstruct file structures.
- ExifTool – not a recovery tool, but can help you inspect the metadata of recovered files to verify they are CR2.
When using any recovery tool, choose the option to recover all files, not just the ones the tool recognizes. You can filter later by file extension (.CR2) or by checking the file header. A CR2 file begins with the bytes 49 49 2A 00 (little-endian TIFF header) followed by 43 52 (the ASCII characters "CR"). You can verify this with a hex editor.
How to Fix a Slightly Damaged CR2 Header
Sometimes the file is not fully lost—only the header is corrupted. The header contains the byte order, magic number, and offsets to the image data. If the header is damaged, most software will refuse to open the file, even though the raw image data is still present.
In that case, you can try to rebuild the header by copying it from a healthy CR2 file taken with the same camera model. The process is technical:
- Open both the corrupted file and a known-good CR2 (from the same camera) in a hex editor.
- Copy the first 8 to 32 bytes from the good file to the corrupted file, making sure not to overwrite the unique image data.
- Save the modified file and try opening it in a raw viewer.
This works because the header is mostly identical for a given camera and settings. However, if the corruption is deeper (for example, in the image data itself), this fix will not restore the photo.
When the Card Is Physically Damaged
If the SD card is physically damaged—cracked, bent, or with a broken connector—software recovery is unlikely to work. In that case, you have two options:
- Try a different card reader: Sometimes the card's gold contacts are dirty or the reader is at fault. Clean the contacts gently with a soft, dry cloth and try another reader.
- Professional data recovery: Companies that specialize in flash memory recovery can read the memory chips directly, bypassing the card's controller. This is expensive and not guaranteed, but it is the only option for severe physical damage.
Do not attempt to disassemble the card yourself. The memory chips are fragile and static-sensitive, and you may permanently destroy the data.
Preventing Future CR2 Corruption
Once you have recovered your files, take steps to avoid the same problem:
- Always format the card in the camera, not on a computer, to ensure the file system matches the camera's expectations.
- Use the "safe eject" option on your computer before removing the card.
- Do not fill the card completely; leave some free space to reduce fragmentation.
- Use a high-quality card reader and avoid cheap USB hubs that may cause power drops.
- Back up your images regularly, ideally to two different storage devices.
Also, be aware that some cameras offer a "dual recording" option (RAW + JPEG) that writes both formats simultaneously. While this does not prevent corruption, it gives you a usable JPEG even if the RAW file is damaged.
Frequently Asked Questions
Can I recover CR2 files from a formatted SD card?
Yes, formatting a card does not immediately erase the data; it only marks the space as available. As long as you have not written new data to the card, recovery software can often find the original files. Stop using the card immediately and use a recovery tool that supports raw formats.
Why does my CR2 file show a preview but won't open?
This is because the embedded JPEG preview is stored separately from the raw image data. The preview may be intact while the raw data is corrupted. You can try extracting the JPEG preview using a tool like ExifTool, which can save the preview to a separate file.
Is free recovery software safe to use?
Yes, reputable free tools like PhotoRec are safe, but always download from official sources. Some freeware may bundle adware, so read the installer options carefully. Also, never install recovery software on the same card you are trying to recover.
How long does a full card scan take?
It depends on the card size and speed. A 64 GB card can take anywhere from 20 minutes to several hours with PhotoRec. The scan reads every sector, so larger and slower cards take longer. Be patient and do not interrupt the scan.
Can I recover CR2 files from a card that the camera says is unreadable?
Sometimes yes. If the camera cannot read the card, it may be a logical issue that recovery software can bypass. However, if the card is physically damaged, software may not help. Try the card in a computer first; if it mounts, recovery is more likely.
What is the difference between CR2 and CR3 recovery?
CR3 is Canon's newer raw format, which uses a different container structure (ISO-BMFF). Recovery software that supports CR2 may not support CR3. Check the software's documentation for CR3 support before attempting recovery.