fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home / image / bmp

Convert BMP Image Free

.bmp looks simple until you count the variants

A BMP is a 14-byte file header, a DIB header that comes in seven sizes, an optional palette, and pixel rows usually stored bottom-up, each padded to a multiple of 4 bytes. Within that frame there are 1- to 32-bit depths, two run-length codecs, bit masks, alpha that may or may not count, and even PNG or JPEG wrapped inside. This page reads all of them with its own decoder, writes 12 variants of one image, and asks your browser which it can actually show.

folder_openOpen .bmp / .dib24-bit, odd width8-bit RLE832-bit V5 with alpha
sample-24.bmp: 24-bit, bottom-up, 101 × 67 written here
BITMAPINFOHEADER · 101 × 67 · 24-bit · BI_RGB54 header bytes
0bfType42 4D“BM”
2bfSizeC6 4F 00 0020,422 bytes = file size ✓
6bfReserved00 00 00 00should be 0
10bfOffBits36 00 00 00pixels start at byte 54
14biSize28 00 00 0040 = BITMAPINFOHEADER
18biWidth65 00 00 00101 px
22biHeight43 00 00 0067 → positive: rows stored bottom-up
26biPlanes01 001
28biBitCount18 0024-bit
30biCompression00 00 00 000 = BI_RGB
34biSizeImage90 4F 00 0020,368 bytes
38biXPelsPerMeter13 0B 00 002835 ≈ 72.0 dpi
42biYPelsPerMeter13 0B 00 002835 ≈ 72.0 dpi
46biClrUsed00 00 00 000 = no palette
50biClrImportant00 00 00 000 = all

The file, byte for byte

20.4 KB · pixels start at 54
file headerDIB headerpixels
this page’s decoder
your browser’s decoder
first rows in the file · last 14 of 304 bytes each
file row 0 = image row 66 (the bottom one)
0000000000000000000000000000
file row 1 = image row 65
0000000000000000000000000000
file row 2 = image row 64
0000000000000000000000000000
file row 66 = image row 0
0000000000000000000000000000
Your browser and this page decode it identically (max channel difference 0).
check_circlebfSize matches the file.Some writers leave it 0 or wrong; readers mostly ignore it.
check_circleBITMAPINFOHEADER.The most widely supported header.
check_circleRows stored bottom-up.The first row in the file is the bottom of the picture, a legacy of OS/2’s coordinate system.
check_circleStride 304 bytes, 1 padding per row.67 bytes of padding in total (0.3%).
check_circleResolution 72 dpi.Stored as pixels per metre (2835); 2835 is the usual 72 dpi.
variant lab · 12 real files written here, decoded by your browser

One image, twelve BMPs, and which ones your browser can show

The source is 101 × 67 pixels, an odd width so every row needs padding, with rounded transparent corners and a 60%-transparent circle. Each variant is written by this page, handed to createImageBitmap, and compared pixel by pixel with this page’s own decoder. Palette variants lose colour by design; what matters is whether the browser shows the same pixels and what it does with alpha. Click “inspect” to load a variant above.

1-bit, 2-colour paletteBI_RGB · 40-byte header
1.1 KBdecoded
identical to this page’s decoder
inspectdownload
4-bit, 16-colour paletteBI_RGB · popularity palette
3.6 KBdecoded
identical to this page’s decoder
inspectdownload
4-bit RLE4BI_RLE4 · runs of nibble pairs
2.4 KBdecoded
identical to this page’s decoder
inspectdownload
8-bit, 256-colour 3-3-2 paletteBI_RGB
8.0 KBdecoded
identical to this page’s decoder
inspectdownload
8-bit RLE8BI_RLE8 · runs + absolute mode
3.4 KBdecoded
identical to this page’s decoder
inspectdownload
16-bit RGB565BI_BITFIELDS · 3 masks
13.7 KBdecoded
identical to this page’s decoder
inspectdownload
24-bit, bottom-upBI_RGB · the classic BMP
20.4 KBdecoded
identical to this page’s decoder
inspectdownload
24-bit, top-downnegative biHeight
20.4 KBdecoded
identical to this page’s decoder
inspectdownload
24-bit OS/2 core header12-byte BITMAPCOREHEADER
20.4 KBdecoded
identical to this page’s decoder
inspectdownload
32-bit BI_RGB with alpha bytesalpha in the “unused” byte
27.1 KBdecoded
alpha ignored: shown opaque
inspectdownload
32-bit V5 with alpha maskBI_BITFIELDS · sRGB · 124-byte header
27.2 KBdecoded
alpha shown: 1,231 see-through pixels
inspectdownload
refused
PNG inside a BMPBI_PNG · biBitCount 0
9.6 KBrefused
browsers don’t unwrap BI_PNG
inspectdownload
stride lab

Why a 1-pixel-wide image needs 4 bytes a row

Every BMP row is padded to a 32-bit boundary: stride = ⌊(width × bits + 31) / 32⌋ × 4. Readers that forget it get the classic sheared, diagonal-striped image, because each row starts a few bytes too early. Change the width and depth to see the bytes of one row.

1-bit4-bit8-bit16-bit24-bit32-bit
16 Bstride per row
1 Bpadding per row
6%of each row wasted
p0p0p0p1p1p1p2p2p2p3p3p3p4p4p4pad
5 px × 24 bits = 120 bits = 15 bytes of pixels, rounded up to 16. At 1080 rows that is 1,080 bytes of padding.

Reference

sizeDIB headeradds
12BITMAPCOREHEADEROS/2 1.x: 16-bit width/height, 3-byte palette entries
40BITMAPINFOHEADERWindows 3.0: 32-bit sizes, compression, resolution, palette count
52V2 (Adobe)RGB bit masks inside the header
56V3 (Adobe)plus an alpha mask
64OS/2 2.xhalftoning and units; rare
108BITMAPV4HEADERWindows 95/NT 4: masks with alpha, colour space, endpoints, gamma
124BITMAPV5HEADERWindows 98/2000: rendering intent, linked or embedded ICC profile
idcompressionmeaning
0BI_RGBuncompressed; 16-bit means 5-5-5
1BI_RLE8run-length for 8-bit, bottom-up only
2BI_RLE4run-length for 4-bit
3BI_BITFIELDSuncompressed with explicit masks (16/32-bit)
4BI_JPEGa JPEG stream, for printers
5BI_PNGa PNG stream, for printers
6BI_ALPHABITFIELDSmasks incl. alpha after a 40-byte header (Windows CE)
11BI_CMYKWindows Metafile only
12BI_CMYKRLE8Windows Metafile only
13BI_CMYKRLE4Windows Metafile only
MIMEimage/bmp (also image/x-ms-bmp)
Extensions.bmp, .dib; .ico/.cur store headerless DIBs with doubled height for the AND mask
Magic bytes42 4D “BM” at offset 0; browsers sniff exactly this
Byte orderlittle-endian throughout; colours stored blue-green-red
Limitswidth and height are signed 32-bit; file size field is 32-bit, so 4 GB
ClipboardWindows CF_DIB / CF_DIBV5 are BMPs without the 14-byte file header
Alphaonly reliable with V4/V5 headers and an alpha mask; 32-bit BI_RGB alpha is a convention, not a rule
Sizeusually uncompressed: a 12 MP photo is about 36 MB as 24-bit BMP
1988OS/2 1.1Presentation Manager defines the bitmap file with the 12-byte core header.
1990Windows 3.0Device-independent bitmaps with BITMAPINFOHEADER and RLE compression.
1995V4 headerWindows 95 adds bit masks, alpha and colour-space fields.
1998V5 headerWindows 98 adds ICC profiles and JPEG/PNG passthrough.

Getting out of BMP