DNG File Documentation


Summary

A DNG (Digital Negative) file is a RAW photo in Adobe’s open, TIFF-based raw image format: the unprocessed data straight off the camera sensor, stored so it can be developed before sharing. Introduced by Adobe in 2004 and built on the TIFF/EP standard, it either comes from converting a proprietary raw (CR2, NEF, ARW) to DNG, or straight from cameras and phones that shoot it natively. Its MIME type is image/x-adobe-dng.

Technical details

FeatureValue
Full nameDigital Negative
File extension.dng
MIME typeimage/x-adobe-dng
Format typeOpen, TIFF/EP-based raw camera image (binary)
DeveloperAdobe Systems
Introduced2004 (DNG 1.0); DNG 1.7 (2023)
StandardPublished spec; underlies ISO 12234-2 (TIFF/EP)
Open standardYes — publicly documented, royalty-free
Container / base formatTIFF (multi-IFD)
Byte orderLittle-endian (usually) or big-endian, declared in the header
Magic number49 49 2A 00 (“II*\0”) or 4D 4D 00 2A (“MM\0*”)
Identifying tagDNGVersion (TIFF tag 50706)
Sensor dataCFA mosaic or linearized; often lossless-JPEG compressed
Colour dataColorMatrix, calibration and camera-profile tags
PreviewOne or more embedded JPEG previews for fast thumbnailing
Original rawOptional embedded copy of the source proprietary raw
MetadataFull EXIF (camera, lens, exposure, ISO, sometimes GPS)
Native sourcesLeica, Pentax/Ricoh, Sigma, DJI drones; Android raw, Apple ProRAW
Related extensions.tiff, .cr2, .nef, .arw, .raw
Specificationhelpx.adobe.com/camera-raw/digital-negative.html
File signature (magic bytes)
49 49 2A 00

Offset 0, 4 bytes. DNG is built on TIFF, so it begins with the TIFF header: 49 49 2A 00 (“II*\0”, little-endian, the usual case) or 4D 4D 00 2A (“MM\0*”, big-endian). The first two bytes set the byte order for the whole file; the value 42 (2A 00) is TIFF’s version magic, followed by a 4-byte offset to the first Image File Directory. A DNG is told apart from a plain TIFF by the presence of the DNGVersion tag (50706) and raw sensor data; there is no separate DNG magic number.

What is a DNG file?

DNG stands for Digital Negative, an openly published raw image format introduced by Adobe Systems in 2004 as a non-proprietary, archival container for camera raw data. Like any raw file it stores the unprocessed signal from the camera sensor, before demosaicing, white balance, sharpening or lossy compression are applied. That is the sense of “negative”: the file holds the full captured tonal range and must be developed in software, which gives far more latitude to recover highlights and shadows or reset white balance than a finished JPEG allows.

DNG exists to solve a longevity and interoperability problem. Every camera maker uses its own raw format (Canon CR2 and CR3, Nikon NEF, Sony ARW, Fujifilm RAF), each needing constantly updated, vendor-specific decoders. DNG is documented and standardised (it underlies the TIFF/EP standard, ISO 12234-2), so it is favoured for long-term archiving and is broadly readable. Photographers meet it two ways: by converting proprietary raws to DNG with Adobe’s free DNG Converter, and directly from cameras and phones that write DNG natively, including many Leica, Pentax/Ricoh and Sigma cameras, DJI drones, Android raw capture, and Apple ProRAW since the iPhone 12 Pro.

A TIFF container: header, IFDs and tags

A DNG is not a bespoke binary format. It is a TIFF file, and it obeys TIFF’s structure exactly. The file opens with an 8-byte TIFF header: two bytes of byte-order marker (II for little-endian or MM for big-endian), the 16-bit constant 42, and a 32-bit offset to the first Image File Directory (IFD). An IFD is a table of tagged fields; each entry names a tag number, a data type, a count, and either a value or a pointer to the value elsewhere in the file. TIFF’s IFDs can be chained and nested, and DNG uses that freedom heavily.

Offset 0   II * 0        TIFF header, little-endian, magic 42
Offset 4   ->  first IFD  (the metadata / preview IFD)
  IFD0 entries:
    NewSubFileType, ImageWidth/Length (of the preview or thumbnail)
    Make, Model, Orientation, ... (EXIF-style tags)
    DNGVersion (50706)          <- marks this as a DNG
    DNGBackwardVersion (50707)
    SubIFDs (330) -> raw IFD(s) that hold the actual sensor data
    EXIF IFD pointer -> exposure, ISO, lens, GPS

The tag that makes a TIFF a DNG is DNGVersion, TIFF tag 50706, a 4-byte value giving the DNG specification version the file was written to (for example 1.4.0.0). A companion tag, DNGBackwardVersion (50707), tells a reader the oldest version that can still interpret the file. Without DNGVersion, the same bytes would be read as an ordinary TIFF.

The IFD tree: previews in IFD0, raw data in SubIFDs

DNG deliberately separates the small, human-viewable images from the large raw payload by putting them in different IFDs. The first IFD typically describes a reduced-size preview or thumbnail, so that a file browser can show something instantly without decoding the sensor data. The NewSubFileType tag on each IFD says what that IFD contains: a reduced-resolution preview, a full-resolution image, or the primary raw.

The heavy data lives in SubIFDs, referenced from IFD0 through the SubIFDs tag (330). One SubIFD holds the raw sensor image; others may hold additional previews, including a full-size JPEG preview used by Lightroom-style tools for fast display. This is why a DNG can be viewed quickly even though decoding the raw is expensive: the reader shows an embedded JPEG preview first and only demosaics the sensor data when you actually develop the photo.

CFA data, the Bayer pattern and demosaicing

The core of a DNG is the sensor image, and for most cameras it is a Color Filter Array (CFA) mosaic rather than a normal RGB picture. A camera sensor records only one colour per photosite, arranged in a repeating pattern (most commonly the Bayer pattern, two greens for every red and blue). DNG stores that single-channel mosaic together with the tags a reader needs to interpret it: CFARepeatPatternDim gives the size of the repeating tile, and CFAPattern gives the colour of each position in it (which cells are red, green or blue).

Turning that mosaic into a full-colour image is demosaicing, and it happens in the raw developer, not in the file. The DNG keeps the mosaic so the developer can apply its own interpolation, and this is one reason raw gives more editing latitude than JPEG: the reconstruction has not yet been baked in. Some DNGs instead store linear (already demosaiced) data, flagged by the PhotometricInterpretation tag, which trades editing flexibility for a simpler, larger image.

Colour calibration: turning raw counts into colour

Raw sensor counts are not colours until they are mapped into a colour space, and DNG carries the calibration data that makes that mapping camera-accurate. The key tags are the two ColorMatrix tags (one per calibration illuminant, typically a warm and a cool reference light), which give the 3×3 matrix converting the camera’s native response to the CIE XYZ colour space. Companion tags such as CalibrationIlluminant, AnalogBalance and AsShotNeutral let a developer interpolate between the two matrices based on the scene’s white balance.

Because this profile data travels inside the DNG, any conformant reader can render the file’s colours correctly without a secret, camera-specific decoder. That portability is the practical payoff of DNG’s openness: the information a proprietary raw hides in an undocumented maker-note is written out as standard DNG tags instead.

Compression and the embedded original

DNG can store the sensor data uncompressed, but it more often uses lossless JPEG compression on the raw mosaic, which shrinks the file substantially while remaining bit-exact. DNG 1.4 added a lossy compression option for photographers who accept some data loss for smaller archives, but the default and archival choice is lossless.

A distinctive DNG feature is the ability to embed the camera’s original proprietary raw inside the DNG, stored in the OriginalRawFileData tag. When the DNG Converter is set to embed the original, nothing from the source file is discarded: the DNG becomes both an open, readable copy and a lossless container for the exact bytes of the camera’s CR2 or NEF, from which the original can later be extracted. This is what makes DNG conversion safe for archiving without fear of losing the source raw.

Why you develop a DNG rather than edit it

A DNG is a starting point, not a finished picture. You do not edit it in place; you open it in a raw developer (darktable, RawTherapee, Adobe Camera Raw), make non-destructive adjustments that are recorded as instructions in a sidecar or catalog, and export a rendered image. The most common export is JPG for sharing, or a 16-bit TIFF for a lossless processed master. One conversion is genuinely impossible: you cannot turn a DNG back into a Canon CR2 or Nikon NEF. DNG is the open destination format, so proprietary raws convert to DNG, never the other way; to leave Adobe’s format you export TIFF or JPEG instead. On Windows the operating system does not decode raw out of the box, which is why DNG thumbnails require Microsoft’s free Raw Image Extension to appear in File Explorer.

Frequently asked questions

Is DNG the same as RAW?

DNG is a specific, open raw format; “RAW” is the generic term for unprocessed sensor files, of which CR2, NEF, ARW and DNG are all examples. So a DNG is a raw file, just the standardised, non-proprietary kind, defined by a published specification rather than a secret vendor format.

If a DNG is a TIFF, can a TIFF reader open it?

A generic TIFF reader can parse the file structure and often show the embedded preview, but it cannot correctly render the raw sensor data, because that needs the DNG colour-calibration tags and a demosaicing step a plain TIFF viewer does not perform. Full rendering requires a raw developer that understands the DNGVersion tag and the CFA and colour-matrix tags.

Why can’t I see DNG thumbnails on Windows?

Windows does not include a raw decoder by default. Installing the free Raw Image Extension from the Microsoft Store adds one, after which DNG previews appear in File Explorer and the Photos app because Windows can then read the file’s embedded JPEG preview and sensor data.

References