CR2 File Documentation
Summary
A .cr2 file is a Canon Raw 2 image: the unprocessed data straight off the sensor of a Canon DSLR (2004–2018 era), like a digital negative. It is a TIFF-based binary holding the raw sensor pixels, EXIF metadata, and embedded JPEG previews. On Windows, install the free Raw Image Extension to see thumbnails; develop it in Canon’s free Digital Photo Professional or darktable, then export to JPG. Newer cameras use CR3. MIME: image/x-canon-cr2.
Technical details
| Feature | Value |
|---|---|
| Full name | Canon Raw version 2 (CR2) |
| File extension | .cr2 |
| MIME type | image/x-canon-cr2 |
| Developer | Canon Inc. |
| Introduced | 2004 (EOS 20D); used through ~2018 |
| Format type | TIFF-based proprietary camera raw image |
| Container / base format | TIFF 6.0 (Image File Directory structure) |
| Open standard | No — proprietary, model-specific variants |
| Binary | Yes |
| Byte order | Little-endian (II) |
| Magic number (hex) | 49 49 2A 00 at offset 0; 43 52 02 (“CR” + v2) at offset 8 |
| Colour depth | 14-bit per channel (sensor), single-channel CFA |
| Raw data compression | Lossless JPEG (ITU-T T.81 lossless mode) |
| Sensor pattern | Bayer colour filter array (RGGB), undemosaiced |
| Metadata | EXIF + Canon MakerNote (camera, lens, exposure, WB, focus) |
| Embedded previews | JPEG thumbnail + reduced + full-size preview |
| IFD layout | IFD0 preview/metadata, IFD1 thumbnail, IFD2 RGB preview, IFD3 raw CFA |
| Successor | CR3 (ISO BMFF / MOV-based container) |
| Related extensions | .cr3, .crw, .dng, .tiff, .nef, .jpg |
| Key conversions | CR2 → JPG (share), → DNG (archive), → TIFF (edit) |
| Specification URL | lclevy.free.fr/cr2/ (reverse-engineered reference) |
What is a CR2 file?
A .cr2 file is a Canon Raw version 2 image: the unprocessed data recorded by the sensor of a Canon EOS DSLR, saved without the in-camera development that produces a JPEG. Canon introduced CR2 with the EOS 20D in 2004 and used it across its DSLR line until around 2018, when the CR3 format replaced it. A raw file is best thought of as a digital negative. Where a JPEG has already been demosaiced, white-balanced, sharpened, and lossily compressed inside the camera, a CR2 preserves the sensor’s original measurements, giving an editor far more latitude to recover highlights and shadows and to set white balance after the fact, at the cost of a large file that needs software to “develop” it.
Technically CR2 is not a bespoke format but a specialisation of TIFF. It uses TIFF’s container and its Image File Directory structure, adds a small Canon marker to identify itself, and packs several images (previews plus the actual raw sensor data) into one file. The sections below follow the bytes: the TIFF-derived header, the four IFDs and what each holds, the Bayer colour filter array that makes raw data monochrome until demosaiced, the lossless-JPEG compression of the sensor data, and why CR3 broke compatibility.
The TIFF header and the Canon CR marker
The first 16 bytes of a CR2 are its header, and the first eight of those are a standard TIFF header, which is why generic tools recognise a CR2 as a TIFF.
Offset Bytes Meaning
0 49 49 "II" - Intel/little-endian byte order
2 2A 00 42 - the TIFF magic number
4 10 00 00 00 offset to IFD0 (here 0x10 = 16)
8 43 52 "CR" - Canon Raw marker
10 02 CR2 major version (2)
11 00 CR2 minor version (0)
12 xx xx xx xx offset to the raw-data IFD (IFD3)
Bytes 0–1 declare little-endian order (II, for Intel; big-endian TIFFs use MM). Bytes 2–3 are the constant 42 that confirms TIFF. Bytes 4–7 point to the first Image File Directory. The eight bytes from offset 8 are the CR2 extension proper: the ASCII letters CR, a version pair, and a direct offset to the IFD that holds the raw sensor data. Because a plain TIFF has no CR at offset 8, that marker is the reliable way to tell a Canon raw from an ordinary TIFF that merely shares the 49 49 2A 00 start.
The four IFDs: previews, thumbnail and raw data
A TIFF file is a linked list of Image File Directories, each an array of tagged entries describing one image plus a pointer to the next IFD. A CR2 uses this to store four images in the one file, which is the whole reason a raw can show a full-colour thumbnail before any software has demosaiced a single pixel.
| IFD | Contents |
|---|---|
| IFD0 | A reduced-size JPEG preview plus the primary metadata; the EXIF block hangs off IFD0 via the Exif IFD pointer. |
| IFD1 | A small JPEG thumbnail for fast browsing in file managers. |
| IFD2 | An uncompressed RGB preview image. |
| IFD3 | The actual raw sensor data (the CFA image), stored as lossless JPEG. This is the IFD the offset at header byte 12 points to. |
An IFD entry is a tag: a 2-byte tag ID, a 2-byte data type, a 4-byte count, and a 4-byte value or offset. Standard TIFF tags describe each image’s width, height, bits per sample, compression, and where its pixel strips live. This tag machinery is inherited unchanged from TIFF, which is why a TIFF library can walk a CR2’s directory structure and pull out the embedded JPEG previews even without understanding Canon’s raw encoding. The camera-specific settings that a raw developer needs (the exact sensor model, white-balance coefficients, colour matrices, lens data) live in the Canon MakerNote, a large private block inside the EXIF metadata whose internal layout differs from model to model.
The Bayer colour filter array: why raw data is monochrome
The raw image in IFD3 is not an RGB picture. A camera sensor measures only light intensity, not colour, so Canon overlays a Bayer colour filter array: a mosaic of red, green, and blue filters, one colour per photosite, arranged in a repeating 2×2 pattern with two greens for every red and blue (an RGGB grid, matching the eye’s sensitivity to green). Each pixel in the raw therefore records the intensity behind a single colour filter, giving a single-channel image where each sample is one colour. Turning that mosaic into a full-colour image, where every pixel has all three of R, G, and B, is demosaicing: an interpolation that estimates the two missing colours at each site from its neighbours. That step happens in the raw developer on your computer, not in the CR2. It is precisely because the CR2 stores the pre-demosaic measurements, at the sensor’s full 14-bit precision, that raw editing can reconstruct white balance and recover detail that an already-demosaiced 8-bit JPEG has thrown away.
Lossless JPEG compression of the sensor data
The raw CFA data is not stored uncompressed. Canon compresses it with the original lossless JPEG mode from the ITU-T T.81 standard, the same predictive lossless scheme Adobe’s DNG also uses for Canon raws. Lossless JPEG is unrelated to the lossy DCT compression of an ordinary photographic JPEG: it predicts each sample from already-decoded neighbours and entropy-codes only the small prediction error, so the sensor values are reconstructed exactly with no quality loss. One consequence of packing a Bayer mosaic into a JPEG stream is a dimensional quirk: the JPEG’s declared width is often half the real image width because two colour channels are interleaved per horizontal step, and several early bodies (300D-era, 5D, 30D) wrote the data in vertical “slices” that a decoder must reassemble. This model-by-model variation is why raw software ships regularly updated camera profiles: decoding a new Canon body correctly requires knowing its exact CFA layout, slice arrangement, and black/white levels.
Why CR3 is not a newer CR2
Canon’s current cameras produce CR3, and it is a clean break rather than an increment. CR2 is built on TIFF; CR3 is built on the ISO Base Media File Format, the same box-based container as MP4 and MOV. Instead of TIFF IFDs, a CR3 is a tree of boxes (ftyp, moov, mdat, and Canon’s own CRAW/CTMD boxes), and the raw data can use Canon’s newer compression. Because the containers are fundamentally different, you cannot up-convert an old CR2 into a CR3; there is no meaningful path between them. To move a Canon raw out of the proprietary ecosystem entirely, the archival route is conversion to DNG, an openly documented raw format that keeps the sensor data while dropping Canon’s private wrapper. For sharing, the CR2 is developed and exported to a processed JPG; for a lossless processed master, to a 16-bit TIFF.
Embedded previews, EXIF and what Explorer actually shows
When Windows or a file browser displays a CR2 thumbnail, it is not decoding the raw; it is reading one of the embedded JPEGs from IFD1 or IFD0. This is why a system that lacks a Canon raw decoder can still show some preview if it can parse TIFF, and why installing the free Raw Image Extension on Windows (which adds an actual CR2 codec) improves previews and enables the Photos app to render the developed image. The EXIF and MakerNote metadata travel with the file and include camera and lens identifiers, exposure settings, timestamps, and sometimes GPS coordinates. That last point is a privacy consideration rather than a security one: publishing a CR2 (or a JPEG exported without stripping metadata) can leak where and when a photo was taken.
Frequently asked questions
Why does the raw data in a CR2 have no colour?
The sensor measures light intensity through a Bayer colour filter array, so each photosite records only one of red, green, or blue. The stored raw is therefore a single-channel mosaic. A full-colour image is produced later by demosaicing, an interpolation done in the raw developer, which is why the CR2 itself holds monochrome-looking CFA data.
Can I convert a CR2 into a CR3?
No. CR2 is a TIFF-based format and CR3 is built on the MOV/ISO BMFF box container; they are structurally unrelated, and CR3 is tied to newer camera bodies. There is no up-conversion. To leave Canon’s proprietary format for an open, well-documented raw archive, convert the CR2 to DNG instead.
References
- Inside the Canon RAW format version 2 (CR2 structure reference)
- libopenraw — Canon CR2 format notes
- Microsoft Store — Raw Image Extension (CR2 codec for Windows)
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.