What is the BMP file format?
.bmp is an image file that stores raster graphics, developed by Microsoft (with IBM, for OS/2). BMP format is almost always uncompressed, so high-resolution images saved as .bmp files are larger than files saved in comparable formats such as PNG or JPEG. Optional run-length encoding (RLE) compression exists but is rarely used.
BMP is capable of storing images in various color depths:
- 1-bit monochrome (black and white only),
- 4-bit (16 distinct colors),
- 8-bit (256 distinct colors),
- 16-bit, 24-bit, or 32-bit color (the latter adds an alpha channel for transparency).
File structure
Each .bmp file has a header section which contains information about the color depth, file size, and pixel data offset, followed by an array representing bitmap pixels. Rows are stored bottom-up and padded to 4-byte boundaries. Four DIB header versions exist - BITMAPCOREHEADER, BITMAPINFOHEADER, BITMAPV4HEADER, and BITMAPV5HEADER - the last of which adds embedded ICC color profiles.
Security & safety
RISK: LOWBMP is plain pixel data with no scripts or macros, so the format itself is low-risk. The only caveats: historically a few image-library bugs allowed malformed BMP headers (huge claimed dimensions, bad RLE runs) to crash or overflow parsers, so keep your viewer updated; and avoid ad-laden "free BMP converter" sites - use IrfanView, GIMP, ImageMagick or Squoosh instead.
Format details
in a nutshellPrograms that open BMP files
Technical details
deep spec| MIME type | image/bmp (also image/x-bmp, image/x-ms-bmp) |
| Magic bytes | 42 4D ("BM") at byte offset 0 |
| Byte order | Little-endian |
| Compression | Typically none (BI_RGB); optional BI_RLE8 and BI_RLE4 run-length encoding; rare BI_BITFIELDS, BI_JPEG, BI_PNG |
| Supported color depths | 1, 4, 8, 16, 24, or 32 bits per pixel |
| Pixel row storage | Bottom-up by default (last row first); negative height value signals top-down; each row padded to a 4-byte boundary |
| File header | BITMAPFILEHEADER - 14 bytes; contains BM signature, total file size, and pixel-data offset |
| DIB header versions | BITMAPCOREHEADER (12 bytes), BITMAPINFOHEADER (40 bytes), BITMAPV4HEADER (108 bytes), BITMAPV5HEADER (124 bytes); version identified by DWORD at offset 0x0E |
| Alpha channel | Supported in 32-bit mode via BITMAPV4HEADER and BITMAPV5HEADER; not available in 24-bit or earlier header versions |
| Maximum image dimensions | Up to ~2.1 billion pixels per side (32-bit signed int in BITMAPINFOHEADER); BITMAPCOREHEADER limits to 65,535 px per side |
| Color palette | Optional; up to 256 RGBQUAD entries used for indexed modes (1, 4, 8 bpp) |
| ICC color profile | Embedded ICC profile support added in BITMAPV5HEADER (Windows 98/2000); earlier headers carry no color-space metadata |
| Alternative extension | .dib (Device Independent Bitmap) - identical format, used interchangeably on Windows |
| OS/2 variants | OS/2 Bitmap Array files use alternative magic signatures: BA, CI, CP, IC, PT |
| Released | 1985-1990 (Windows 1.0/2.0; OS/2 1.x); BITMAPINFOHEADER form with Windows 3.0 (1990) |
| Latest version | BITMAPV5HEADER (Windows 98/2000, 1998) - adds ICC color profiles |
| Open standard | Yes · royalty-free |
| Specification | learn.microsoft.com |
BMP conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about BMP files.