BMP / ICO File Inspector

Inspect BMP DIB header and ICO directory — size, bit depth, color planes

Ad placeholder (leaderboard)

Decode the binary header of a Windows bitmap (.bmp) or icon (.ico) file — its dimensions, bit depth, compression and, for icons, every resolution packed inside. The inspector reads the BITMAPFILEHEADER, BITMAPINFOHEADER and ICO directory directly with the browser’s DataView API, entirely on your device.

How it works

BMP

A BMP starts with a 14-byte BITMAPFILEHEADER:

bytes 0-1  : "BM" signature
bytes 2-5  : total file size (LE)
bytes 10-13: offset to pixel data

then a 40-byte BITMAPINFOHEADER (the common DIB header):

biSize         (4)  header size, usually 40
biWidth        (4)  pixel width (signed)
biHeight       (4)  pixel height (signed; negative = top-down)
biPlanes       (2)  color planes, always 1
biBitCount     (2)  bits per pixel: 1, 4, 8, 16, 24, 32
biCompression  (4)  0=RGB, 1=RLE8, 2=RLE4, 3=BITFIELDS, 4=JPEG, 5=PNG
biSizeImage    (4)  pixel data size in bytes
biClrUsed      (4)  palette entries used

ICO

An icon file begins with a 6-byte header: a reserved word, a type word (1 = icon, 2 = cursor) and the image count. Each image then has a 16-byte directory entry:

width  (1)  0 means 256
height (1)  0 means 256
colors (1)  palette size, 0 if ≥256
reserved(1)
planes (2)
bitCount(2)
bytesInRes(4)  size of this image's data
imageOffset(4) where its data starts

The inspector walks the directory and lists every entry, so you can confirm a favicon really contains 16×16, 32×32 and 48×48 variants.

Tips

  • A 32-bit BMP with compression 3 (BITFIELDS) carries an alpha channel via custom channel masks.
  • ICO entries with bytesInRes beginning with the PNG signature are PNG-compressed icons, common for 256×256 sizes — the inspector flags those.
  • If the BMP biSizeImage is 0 it is legal for uncompressed images; the size can be recomputed from width, height, bit depth and row padding (rows pad to a 4-byte boundary).
Ad placeholder (rectangle)