file in abyss
Back to formats

Image

BMP Windows Bitmap

Windows Bitmap is a image format commonly identified by .bmp, .dib. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .bmp, .dib
MIME image/bmp, image/x-ms-bmp

Magic numbers

Analyze your file
offset 0 Windows Bitmap leading signature
42 4D
BM

Structure

  1. Bitmap file header
  2. DIB header
  3. Optional color table
  4. Pixel array

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 42 4D, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("424d")
OFFSET = 0

def is_bmp(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

Windows Bitmap is commonly used for image previews, thumbnails, metadata checks, and upload validation. Test multiple sizes because resolution, alpha support, compression, and file size often affect implementation behavior.

Common detection mistakes

  • The .bmp / .dib extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • Windows Bitmap can start with signatures such as 42 4D, but related containers and damaged files may require additional validation.

Security notes

Media files can still stress decoders through corrupt metadata, extreme dimensions, long durations, or unusual chunks. Read size, dimensions, and duration before processing.

Using samples

11 samples help test tiny images, high-resolution images, alpha channels, and hard-to-compress assets.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Flower Garden BMP preview

Flower Garden BMP

Flower Garden BMP is a Windows Bitmap sample based on Wikimedia Commons, 960 x 540. It can be used to test downloads, parsers, previews, and file type detection.

flower-garden.bmp
Resolution 960 x 540 518 Kpx
PreviewLarge file
1.48 MB
SHA-256 20168aa7ce4606e585704083cd724df1125fa00393a9544253a67b420c501c11
Download
Blue Sky BMP preview

Blue Sky BMP

Blue Sky BMP is a Windows Bitmap sample based on Wikimedia Commons, 96 x 72. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.bmp
Resolution 96 x 72 7 Kpx
Preview
20 KB
SHA-256 4eb92e5e90fe8f5db763d86c90e5edbbedb528f74da8e86d7df3d9f86e8a97b4
Download
Flower Garden BMP preview

Flower Garden BMP

Flower Garden BMP is a Windows Bitmap sample based on Wikimedia Commons, 160 x 90. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.bmp
Resolution 160 x 90 14 Kpx
Preview
42 KB
SHA-256 ab2ba06de24e5e14216b7776893ed83553effd903885322b3001e352848f1f91
Download
Navy Blue Sky BMP preview

Navy Blue Sky BMP

Navy Blue Sky BMP is a Windows Bitmap sample based on Wikimedia Commons, 256 x 128. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.bmp
Resolution 256 x 128 33 Kpx
Preview
96 KB
SHA-256 bf2979e754d0dc037ca38069660421dcbe0242d259a561536b6d9ae1faf1f1e2
Download
Nature of the Sky BMP preview

Nature of the Sky BMP

Nature of the Sky BMP is a Windows Bitmap sample based on Wikimedia Commons, 360 x 270. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.bmp
Resolution 360 x 270 97 Kpx
Preview
285 KB
SHA-256 ee8aec450b9063e52f737c7c925e0110ec83b608b1d4cb5eda95452a33667f3a
Download
Sky Landscape BMP preview

Sky Landscape BMP

Sky Landscape BMP is a Windows Bitmap sample based on Wikimedia Commons, 512 x 384. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.bmp
Resolution 512 x 384 197 Kpx
Preview
576 KB
SHA-256 b31a1aa2677aa0e8d9d03f898f02345a3c09f5fa052d6130c5e3e40c1bb8d7e1
Download
Starry Sky BMP preview

Starry Sky BMP

Starry Sky BMP is a Windows Bitmap sample based on Wikimedia Commons, 720 x 480. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.bmp
Resolution 720 x 480 346 Kpx
Preview
1013 KB
SHA-256 9a906ff6465e7e95dac75ec3e668c7bb3a5ef49d7e47fa78e71e118f8ac80e9a
Download
Blue Night Sky BMP preview

Blue Night Sky BMP

Blue Night Sky BMP is a Windows Bitmap sample based on Wikimedia Commons, 960 x 640. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.bmp
Resolution 960 x 640 614 Kpx
PreviewLarge file
1.76 MB
SHA-256 24e10e169c35cae48959735dd2e22c4efeda4af70920610dc5338e878da71d88
Download
Hibiscus Flower BMP preview

Hibiscus Flower BMP

Hibiscus Flower BMP is a Windows Bitmap sample based on Wikimedia Commons, 1280 x 2770. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.bmp
Resolution 1280 x 2770 3.5 MP
High resLarge file
10.14 MB
SHA-256 f5ab30cd048fb4d6bd169d3becf00c821285119117d07120bc54ce29ec2fded2
Download
Arctic Sky BMP preview

Arctic Sky BMP

Arctic Sky BMP is a Windows Bitmap sample based on Wikimedia Commons, 1600 x 1062. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.bmp
Resolution 1600 x 1062 1.7 MP
PreviewLarge file
4.86 MB
SHA-256 6beb2e836570ddae27e5cc19ae84dd5da2dd0f9b997bbf473ebb810e0313e256
Download
NASA Blue Marble BMP preview

NASA Blue Marble BMP

NASA Blue Marble BMP is a Windows Bitmap sample based on NASA Image and Video Library, 640 x 640. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.bmp
Resolution 640 x 640 410 Kpx
PreviewLarge file
1.17 MB
SHA-256 4ef15ea61207fb39f3e456260d2571036f2214a352c24bde8badae69cef49e74
Download

Frequently asked questions

What is the magic number (file signature) of Windows Bitmap?

Windows Bitmap files begin with the byte signature 42 4D ("BM"). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of Windows Bitmap?

The MIME type for Windows Bitmap is image/bmp, image/x-ms-bmp.

What file extension does Windows Bitmap use?

Windows Bitmap files use the .bmp, .dib extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats