BMP Image Format Checker
Validate BMP files by parsing binary headers. Check signature, DIB version, bit depth, compression, color tables, and pixel data integrity.
Drop a BMP file here or click to browse
Supports all BMP variants · Max 200 MB · Processed locally
About
BMP (Bitmap) files use a rigid binary structure defined by Microsoft. A corrupt or malformed header causes silent rendering failures across applications. This tool performs byte-level inspection of the 14-byte BITMAPFILEHEADER and the subsequent DIB header (sizes 12 to 124 bytes depending on version). It validates the magic signature (0x42 0x4D), cross-references the declared file size against actual byte count, identifies the compression method (BI_RGB, BI_RLE8, BI_BITFIELDS, etc.), and verifies pixel data integrity by computing expected row stride with 4-byte padding alignment. Mismatched values indicate corruption or non-standard encoding that may fail in strict parsers.
The tool handles all six DIB header versions from the legacy 12-byte OS/2 BITMAPCOREHEADER through the modern 124-byte BITMAPV5HEADER with ICC color profile support. Resolution values stored as pixels per meter are converted to DPI for practical use. Limitation: RLE-compressed pixel streams are not decompressed for per-pixel verification. The integrity check assumes uncompressed or BITFIELDS data layout.
Formulas
The BMP file begins with a 2-byte magic number followed by structured binary headers. Pixel data rows are padded to align on 4-byte boundaries.
Where bpp = bits per pixel, width = image width in pixels. The result is in bytes.
Absolute value of height is used because negative height indicates top-down row order (origin at top-left) versus the default bottom-up order. The file integrity check compares this computed pixel data size against the actual bytes available after the pixel data offset.
Where ppm = pixels per meter (stored in header as a 32-bit signed integer). Multiply by 0.0254 to convert to dots per inch.
When clrUsed is non-zero, that value specifies the actual number of palette entries. Each entry is 4 bytes (BGRA) in BITMAPINFOHEADER and later, or 3 bytes (BGR) in the legacy BITMAPCOREHEADER.
Reference Data
| DIB Header | Size (bytes) | Introduced | Max Bit Depth | Compression Support | Color Space | Notes |
|---|---|---|---|---|---|---|
| BITMAPCOREHEADER | 12 | OS/2 1.x | 24 | None | None | Legacy; uses 16-bit width/height |
| BITMAPINFOHEADER | 40 | Windows 3.0 | 32 | BI_RGB, BI_RLE8, BI_RLE4, BI_BITFIELDS | None | Most common version in the wild |
| BITMAPV2INFOHEADER | 52 | Undocumented | 32 | BI_BITFIELDS | None | Adds RGB bit masks |
| BITMAPV3INFOHEADER | 56 | Undocumented | 32 | BI_ALPHABITFIELDS | None | Adds alpha channel mask |
| BITMAPV4HEADER | 108 | Windows 95 / NT 4.0 | 32 | All + BI_JPEG, BI_PNG | LCS_CALIBRATED_RGB | Adds color space endpoints and gamma |
| BITMAPV5HEADER | 124 | Windows 98 / 2000 | 32 | All | LCS_sRGB, PROFILE_LINKED, PROFILE_EMBEDDED | Full ICC profile support |
| Compression Methods | ||||||
| BI_RGB | 0 | No compression (raw pixels) | ||||
| BI_RLE8 | 1 | Run-length encoding for 8-bit images | ||||
| BI_RLE4 | 2 | Run-length encoding for 4-bit images | ||||
| BI_BITFIELDS | 3 | Pixel format defined by bitmasks (16/32-bit) | ||||
| BI_JPEG | 4 | JPEG-compressed pixel data (V4+) | ||||
| BI_PNG | 5 | PNG-compressed pixel data (V4+) | ||||
| BI_ALPHABITFIELDS | 6 | RGBA bitmasks (V3+, CE only) | ||||
| Bit Depth Reference | ||||||
| 1-bit | Monochrome | 2 colors, palette required | ||||
| 4-bit | 16 colors | Palette required, supports BI_RLE4 | ||||
| 8-bit | 256 colors | Palette required, supports BI_RLE8 | ||||
| 16-bit | High color | Default: 5-5-5 + 1 unused, or BITFIELDS | ||||
| 24-bit | True color | BGR byte order, no alpha, most common | ||||
| 32-bit | True color + alpha | BGRA byte order or BITFIELDS-defined | ||||