Metadata Editor

EXIF EditorEXIF ReaderRemove MetadataGuidesGlossaryAbout

CR2 file metadata: Canon raw layout, maker notes and sidecars

CR2 metadata at a glance

Full nameCanon Raw version 2
Extensions.cr2
MIME typeimage/x-canon-cr2
EXIFYes (TIFF-style IFD0 and ExifIFD)
IPTCNot by default (ExifTool can add tag 0x83BB)
XMPUsually a .xmp sidecar (tag 0x02BC possible)
C2PANo (not written by CR2 cameras)
On metadata-editor.comCR2 files cannot be uploaded to our tools. Use ExifTool or the methods on this page.

A CR2 file is the raw format of Canon cameras from before CR3. It is built like a TIFF: a TIFF header with a Canon signature, then four image directories holding a full-size JPEG preview, a thumbnail, a small RGB image and the raw sensor data. CR2 metadata is mostly standard EXIF plus a very large Canon maker note block, and it is harder to remove than in any consumer format.

Four IFDs in one CR2 file

The first 16 bytes of a Canon EOS 5D Mark II file:

$ xxd -l 16 IMG_0051.CR2
00000000: 4949 2a00 1000 0000 4352 0200 4aad 0000  II*.....CR..J...

II*\0 is a little-endian TIFF header and 10 00 00 00 points to IFD0 at offset 16. Then comes Canon's addition: CR, version 2.0 (02 00), and the offset of the raw IFD (4a ad 00 00). Standard TIFF readers ignore those bytes and follow the IFD chain:

IFDContents in this file
IFD05616x3744 JPEG preview, plus pointers to the ExifIFD and GPS IFD
IFD1160x120 JPEG thumbnail
IFD2362x234 uncompressed RGB image
IFD3Raw sensor data, lossless JPEG split into vertical slices

ExifTool reports the raw IFD with Compression: JPEG (old-style), the TIFF code 6, though the data is lossless JPEG. The IFD0 preview is a finished, camera-rendered JPEG, so quick viewers can show it without decoding the raw data.

Canon maker notes

Count the tags by group and the balance is obvious:

$ exiftool -a -G1 -s IMG_0051.CR2 | awk '{print $1}' | sort | uniq -c
    230 [Canon]
     26 [CanonCustom]
     24 [Composite]
     29 [ExifIFD]
      1 [ExifTool]
      4 [File]
      1 [GPS]
     16 [IFD0]
      3 [IFD1]
     11 [IFD2]
      6 [IFD3]
      2 [InteropIFD]
      7 [System]

The maker notes outnumber the ExifIFD tags almost nine to one. Besides lens data, focus points and picture style, they hold three identifying fields: the camera owner name typed in the camera menu, the body serial number, and an internal serial number. Every copy of the CR2 carries them.

Stripping a CR2 is limited

The usual strip commands fall short on CR2:

$ exiftool -all= IMG_0051.CR2
Warning: [minor] Can't delete IFD0 from CR2 - IMG_0051.CR2
    1 image files updated

On this file, that removed only the GPS IFD. The 230 Canon tags and the ExifIFD stayed. exiftool -makernotes:all= refuses outright with Can't delete MakerNotes from CR2. What works is blanking individual values in place:

exiftool -Canon:OwnerName= -Canon:SerialNumber=0 -Canon:InternalSerialNumber= IMG_0051.CR2

Afterwards, OwnerName is empty and SerialNumber reads 0000000000. Note the Canon: prefix: without it, -SerialNumber=0 writes a new ExifIFD tag and leaves the Canon one untouched.

Sidecars and embedded XMP

Lightroom Classic writes edits and keywords for proprietary raw files to an XMP sidecar next to the CR2, never into the CR2 itself. ExifTool can create one too:

exiftool -o %d%f.xmp IMG_0051.CR2

That produced a 4.2 kB IMG_0051.xmp with the EXIF translated to XMP, including XMP-exifEX:SerialNumber and XMP-exifEX:OwnerName. Sharing sidecars shares those fields. ExifTool can also write XMP (tag 0x02BC) and IPTC (tag 0x83BB) directly into IFD0 of the CR2, but other software may not look for them there.

CR3 replaced CR2

Canon introduced CR3 with the EOS M50, announced in February 2018. CR3 is not TIFF-based: it uses the ISO base media format of MP4, with TIFF structures for IFD0, the ExifIFD, the maker notes and GPS stored in boxes named CMT1 to CMT4. It also brought C-RAW, a lossy compressed raw option.

Getting a JPEG out of a CR2

Our tools do not accept CR2. For a JPEG you can work with, export from a raw editor, or pull the embedded preview:

exiftool -b -PreviewImage IMG_0051.CR2 > IMG_0051.jpg

The result is the full 5616x3744 camera JPEG with no EXIF at all, since Canon stores the preview's metadata only in the CR2's own IFDs. That makes it a clean starting point: add your name and copyright with the metadata editor, and none of the serial numbers come along.

FAQ

Other formats

DNG file metadata: inside Adobe's open raw format

A DNG file is a TIFF-based raw format that keeps EXIF, IPTC and XMP inside the file. How DNG metadata is laid out, how to edit it, and what ProRAW adds.

TIFF file format: where the tags live and what converters lose

A TIFF file is a header plus tag directories. Where EXIF, IPTC, XMP and ICC sit, why some converters drop the EXIF, and what multi-page and BigTIFF change.

JPG file format: segments, metadata and what survives an export

How a JPG file stores metadata: Exif and XMP in APP1, ICC and MPF in APP2, IPTC in APP13, C2PA in APP11, and how to edit it without recompressing the image.

Guides

Other Metadata Tools