Bitmap Image File (.bmp)
Microsoft StandardBitmap Image File (BMP) is Microsoft's fundamental device-independent raster graphics format, storing uncompressed or RLE-compressed scanlines with direct hardware framebuffer compatibility.
Convert BMP to PNG
Free in-browser BMP to PNG converter. Convert files instantly on your device.
Inspect & Metadata
Operating systems and file analyzers identify BMP files by inspecting the leading binary byte sequence:
Byte-Level Header Signature (Magic Bytes)
Operating systems and file analyzers identify BMP files by inspecting the leading binary byte sequence:
HEX SIGNATURE (OFFSET 0):
42 4DASCII REPRESENTATION: BM
Standardization: Microsoft Windows Device-Independent Bitmap (DIB) Architecture
Technical Specifications
| Container Architecture | BITMAPFILEHEADER followed by BITMAPINFOHEADER (DIB) and raster pixel array |
| Compression | Uncompressed raw scanlines, or optional BI_RLE8 / BI_RLE4 run-length encoding |
| Byte Endianness | Little-Endian (Intel x86 byte order) |
| Color Spaces | Device Dependent RGB, sRGB (BITMAPV5HEADER embedded) |
| Channels & Structure | 1-bit monochrome, 4-bit / 8-bit paletted, 16-bit, 24-bit RGB, or 32-bit RGBA |
| Max Dimensions | 2,147,483,647 x 2,147,483,647 pixels (signed 32-bit integer) |
| Transparency | 32-bit BGRA alpha mask supported in modern BITMAPV3HEADER and V5HEADER formats |
| Streaming & Progressive | Non-streamable; scanlines stored upside-down (bottom-up) unless height is negative |
Technical Comparison Matrix: BMP vs Competitors
| Technical Attribute | BMP (Current) | PNG | TIFF | JPG |
|---|---|---|---|---|
| Compression Mode | Uncompressed / Minimal RLE | Lossless Deflate (~70% smaller) | Uncompressed / LZW / Zip | Lossy DCT (~90% smaller) |
| Decode Speed | Instantaneous memory copy | Requires Deflate decompression | Requires LZW/ZIP decompression | Requires IDCT calculation |
| Scanline Ordering | Bottom-to-top (inverted) | Top-to-bottom | Top-to-bottom / Strips | Top-to-bottom MCU blocks |
| Web Suitability | Very poor (bloated payloads) | Excellent for graphics | Poor (desktop publishing) | Excellent for photography |
Common Corruption Modes & Hex Recovery Guide
Image renders sheared diagonally or skewed at an angle.
Root Cause: Incorrect row padding calculation (failure to pad each scanline to a 4-byte boundary).
Recovery: Re-encode using File2File Image Converter to enforce correct 32-bit scanline stride.
Security Analysis & Parser Attack Vectors
BMP decoders often suffer from buffer over-reads when allocating buffers based on untrusted DIB header dimensions.
Known Attack Vectors
- Integer overflow in width * height * bpp calculation leading to small heap allocation and out-of-bounds write.
- Corrupted RLE8/RLE4 run-length escape sequences causing memory writes beyond allocated buffer.
- Denial of service through multi-gigabyte memory allocation triggered by crafted header dimensions.
Defensive Best Practices: Strictly validate DIB header width, height, and bit depth bounds before allocating destination memory.
Historical Origins & Milestones
Key Advantages & Pros
- Zero compression degradation: 100% bit-exact pixel storage with zero compression artifacts.
- Universal native operating system support across all versions of Windows, Linux, and macOS.
- Trivial decoding complexity makes it ideal for embedded microcontrollers and graphics programming education.
Technical Limitations & Cons
- Enormous file sizes due to lack of modern entropy compression like DEFLATE or Huffman coding.
- Inefficient for web transmission or mobile network distribution.
- Bottom-up scanline ordering requires vertical row inversion in modern top-down graphics pipelines.
Interesting Technical Trivia
- BMP stores image scanlines upside-down (bottom to top) by default because of the mathematical Cartesian coordinate system used in OS/2.
- If the height value in the BMP header is set to a negative number, the image is decoded right-side up (top-to-bottom).
- Every scanline in a BMP file must be padded with zeroes to a multiple of 4 bytes (32-bit boundary alignment).
Frequently Asked Technical Questions
Why are BMP files so large?
BMP files store raw, uncompressed color values for every single pixel, whereas formats like PNG compress that data without losing any quality.
Can BMP support transparency?
Yes. 32-bit BMP files (using BITMAPV3HEADER or newer) can store an 8-bit alpha channel, though support varies across older software.
How can I reduce the size of a BMP file?
Converting a BMP file to PNG with File2File.app typically reduces file size by 60% to 85% with zero loss in visual quality.