Metadata Editor

EXIF EditorEXIF ReaderRemove MetadataGuidesGlossaryAbout

Bits per sample: where bit depth is recorded

At a glance

ExifTool tag namesEXIF:BitsPerSample, File:BitsPerSample, PNG:BitDepth
Tag ID / location0x0102 (BitsPerSample)
CategoryImage & file structure
Example value8 8 8
On metadata-editor.comNot shown in our reader or editor. The metadata remover strips it with everything else.

Bit depth is the number of bits stored for each channel of each pixel. Eight bits give 256 levels per channel, sixteen give 65,536. TIFF records it in BitsPerSample (0x0102, IFD0), an array with one entry per sample, so an RGB file reads 8 8 8 rather than 24:

$ exiftool -G1 -s -BitsPerSample -SamplesPerPixel rgb8.tif rgb16.tif
======== rgb8.tif
[IFD0]          BitsPerSample                   : 8 8 8
[IFD0]          SamplesPerPixel                 : 3
======== rgb16.tif
[IFD0]          BitsPerSample                   : 16 16 16
[IFD0]          SamplesPerPixel                 : 3
    2 image files read

Other formats keep the number in their own headers, and ExifTool reports it under different names:

  • JPEG: the precision byte of the SOF marker, shown as File:BitsPerSample. Practically always 8; the standard also allows 12-bit, which you will rarely meet in everyday files.
  • PNG: the bit depth byte in the IHDR chunk, shown as PNG:BitDepth. It is per channel and, depending on color type, can be 1, 2, 4, 8 or 16. A file made with convert -monochrome reported 1.
  • Lossy WebP is always 8-bit, and ExifTool prints no depth for it.

A camera JPEG usually has no BitsPerSample tag in its EXIF. If one turns up in IFD0, JPEG decoders ignore it and go by the SOF value.

When 16 bits pays off

Converting an 8-bit JPEG into a 16-bit TIFF doubled the file in a quick test (2,889,164 to 5,760,312 bytes for the same 1200x800 image) and added no information: the extra bits are padding. Sixteen bits earn their keep when the data comes from a raw file or a scanner and you plan heavy edits, because smooth gradients survive strong curves without banding. The same reasoning applies to a 16-bit PNG.

Bit depth is a property of the pixel data, so there is nothing to edit; to change it you convert the image. Our tools don't display it. Use exiftool -BitsPerSample -BitDepth file, ImageMagick's identify, or your editor's image info panel. The compression tag sits next to it in the same IFD, and the metadata basics guide puts these file-structure fields in context.

Related fields

Other Metadata Tools