SUBMIT A FILE TYPE CONTACT US SUPPORT ABOUT US

What Is a BMP File? How to Open, Check and Convert Bitmaps

A BMP file is a bitmap picture that starts with the bytes 42 4d. Jump to your question below, or work through it in order.

28 min read Updated October 2026 Checked against Microsoft docs and 91 files

What Is a BMP File? The Windows bitmap, and a name that is often wrong

Short answer

BMP files are bitmap pictures: every pixel is stored one after another, usually with no compression. That makes them simple to read and large to store.

A Windows BMP file starts with the letters BM, which are 42 4d in hex. FILExt found that about one in four .bmp files it sampled was another format, so read those two bytes before you blame the picture.

We read 91 BMP test files in four programs. They disagreed on 29 of the 43 unusual files, so a file that fails in one program may open in another. See what the test showed before you call a BMP file broken.

A BMP file has a short header that gives the width, height and bits per pixel, then the pixels. Most skip compression, so they open fast and take up plenty of space.

Picture a folder with scan01.bmp inside. The BMP file is tens of megabytes and your email will not send it. One program says it cannot read it. Most BMP file questions start right there.

Windows 1.0 used a bitmap tied to the screen it was made for. Windows 3.0 added the device-independent bitmap in 1990, and one saved to disk became the BMP file, says Wikipedia. The Library of Congress adds that Microsoft has never published a formal specification for it.

FILExt reports that 75 percent of the .bmp files it sampled are Windows bitmaps and 1 percent store JPEG data. The other 24 percent are other formats, including PNG, ZIP, PDF, TIFF and PSD. Its median Windows bitmap is about 760 KB.

A few other things use the ending too. The section on other meanings covers them.

BMP file facts at a glance

Quick facts about the BMP file extension
Property Value
File extensions .bmp and .dib
Made by Microsoft, as a format for Windows and OS/2
Contains A header, an optional color table and rows of pixels
Compression None in most files. Some use RLE, a simple way to count repeated pixels.
Starts with The letters BM, which are the bytes 42 4d
Media types image/bmp and image/x-bmp
Opens in Browsers, photo apps and image editors
Other meaning A boot logo, a game palette or another format with the .bmp name

Wrong page? Photos saved as .jpg are in the JPG file guide. Pictures saved as .png are in the PNG file guide.

Which Kind of BMP File Do You Have? Read two bytes, then the header size

Read the first two bytes of your file. A Windows BMP file starts with 42 4d, the letters BM. The 4 bytes at offset 14 then give the header size: 40 in most files, 12 in old OS/2 files and 108 or 124 in newer ones.

You do not need an image program for this. The short script below prints one line. Save it as check_bmp.py and replace picture.bmp with your BMP file name.

Read the first bytes of BMP files with Python
import struct, sys
KINDS = {b"\x89PNG": "PNG", b"\xff\xd8\xff": "JPEG", b"GIF8": "GIF", b"RIFF": "RIFF (WebP or AVI)",
         b"PK\x03\x04": "ZIP", b"II*\x00": "TIFF", b"BA": "OS/2 bitmap array"}
HEADERS = {12: "old OS/2 style", 40: "standard", 52: "unofficial", 56: "unofficial",
           64: "OS/2 version 2", 108: "version 4", 124: "version 5"}
data = open(sys.argv[1], "rb").read(64)
if data[:2] == b"BM":
    size = struct.unpack("<I", data[14:18])[0]
    bits = struct.unpack("<H", data[24:26] if size == 12 else data[28:30])[0]
    print("BMP, header", size, "bytes (" + HEADERS.get(size, "unknown") + "), bits per pixel", bits)
else:
    kind = [name for key, name in KINDS.items() if data.startswith(key)]
    print("Not a Windows BMP. First bytes:", data[:8].hex(" "), "-", kind[0] if kind else "unknown")
The answer for one of our test files
python check_bmp.py picture.bmp
BMP, header 40 bytes (standard), bits per pixel 24

We ran it on the BMP Suite files and on seven renamed files. It named the right type for six of our seven renamed files. The seventh was a text file, which it reports as unknown. It reads only the start, so a cut BMP file still reads as a BMP. The table shows the starts it knows.

How to separate the kinds of file that use the BMP ending
Kind First bytes Opens in
Standard BMP 42 4d, then the number 40 at byte 14 Browsers, photo apps and editors
Newer BMP 42 4d, then 108 or 124 at byte 14 Most programs, though some refuse rare variants
Old OS/2 style BMP 42 4d, then 12 at byte 14 Most programs. All four of our readers drew our 12-byte BMP files.
PNG renamed 89 50 4e 47 Any PNG viewer
JPEG renamed ff d8 ff Any JPG viewer
GIF renamed 47 49 46 38 Any GIF viewer
ZIP archive 50 4b 03 04 An unzip program
A decision chart: read the first two bytes. 42 4d means a Windows BMP, and the header size at byte 14 shows the kind. 89 50 4e 47, ff d8 ff or 47 49 46 38 means a PNG, JPEG or GIF file with the wrong name
Two bytes decide. The name .bmp proves nothing.

Three more clues besides the bytes

The size A 1920 by 1080 BMP with 24 bits per pixel is 6,220,854 bytes. A BMP file far smaller than its picture size is compressed, cut short or another format.
The size field Bytes 2 to 5 store the size of the file. In a healthy BMP file they match the size on disk. Our badfilesize.bmp breaks this rule on purpose, and three of our four readers still drew it.
The file command On Linux and Mac, the file command printed PC bitmap and the header kind for 89 of our 91 suite files. For our seven renamed files it named the real type.
Bits per pixel The 2 bytes at offset 28 give the bits per pixel in most files: 1, 4, 8, 16, 24 or 32 in common ones. They set the file size and which programs can read it.

What Is Inside a BMP File? Two headers, a color table and padded rows

A BMP file is a 14-byte file header, an information header, an optional color table and the pixel rows. Rows are padded to a multiple of 4 bytes and stored bottom row first, and a 24-bit pixel is stored blue, green, red.

Think of a printed grid with a short label on the front. The label says how wide the grid is, how many bits a cell uses and where the cells start. Then the cells follow, row after row.

The layout of a BMP file: a 14-byte file header, a 40-byte information header, an optional color table and pixel rows that each end in padding. A 2 by 2 example fills 70 bytes
Our 70-byte test file is this layout with four pixels.

The 14-byte file header

Fields in the file header of BMP files, counted from the start of the file
Offset Size What it stores
0 2 bytes The letters BM, which are 42 4d. Some OS/2 files use other letters, says the Library of Congress.
2 4 bytes The size of the BMP file in bytes
6 4 bytes Two reserved fields, zero in 90 of our 91 suite files
10 4 bytes The offset where the pixel data starts, which is 54 in a 24-bit file with a 40-byte header

The information header

The 4 bytes at offset 14 give the size of the information header. That number is the only version marker, because BMP files have no version field. Width and height come next, and then the bits per pixel and the compression type.

Information header sizes found in BMP files
Size Name What we know
12 Old OS/2 style Width and height use 2 bytes. All four of our readers drew our 12-byte BMP files.
40 Standard The common one. Pillow and ffmpeg write it, and ImageMagick writes it for BMP3 files.
52 and 56 Unofficial Microsoft has not documented them, says Wikipedia. ffmpeg refused both of our files, and the other three drew them.
64 OS/2 version 2 Chromium, ffmpeg and Pillow drew our file right. ImageMagick drew a different picture.
108 Version 4 Added with Windows 95 and NT 4.0. ImageMagick writes it for one-bit files.
124 Version 5 Added with Windows 98 and 2000, and adds color profiles. ImageMagick writes it by default.

A positive height means the rows are stored bottom to top. A negative height means top to bottom. Microsoft says compressed bitmaps must use a positive height.

The pixel rows

Every row takes its width times its bits per pixel, rounded up to a multiple of 4 bytes. Microsoft gives the formula as width times bits, plus 31, with the lowest five bits cleared, divided by 8. The extra bytes are padding.

We made a 2 by 2 BMP file with Pillow: red and green on top, blue and white below. Here are all 70 bytes. The bottom row comes first, and every pixel is stored blue, green, red.

All 70 bytes of our 2 by 2 BMP file
42 4d 46 00 00 00 00 00 00 00 36 00 00 00           file header: BM, 70 bytes in all, pixels start at byte 54
28 00 00 00 02 00 00 00 02 00 00 00 01 00 18 00     info header: size 40, width 2, height 2, 1 plane, 24 bits
00 00 00 00 10 00 00 00 c4 0e 00 00 c4 0e 00 00     no compression, 16 pixel bytes, 3,780 pixels per meter twice
00 00 00 00 00 00 00 00                             colors used and colors that matter: none listed
ff 00 00 ff ff ff 00 00                             bottom row: blue, white, then 2 padding bytes
00 00 ff 00 ff 00 00 00                             top row: red, green, then 2 padding bytes

A row has 2 pixels of 3 bytes, so 6 bytes. The padding rounds it up to 8. Two rows make 16 bytes of pixels. Add the 54 header bytes and the BMP file is 70 bytes. The padding formula matched our files for every width from 1 to 8.

Bit depths and color tables

Bit depths in BMP files and the colors they allow
Bits per pixel Colors How the colors are stored
1 2 A color table with 2 entries, and a pixel is one bit
4 16 A color table with up to 16 entries
8 256 A color table with up to 256 entries
16 32,768 or 65,536 Bit masks decide the split, 5-5-5 or 5-6-5
24 16.7 million Blue, green and red bytes, with no color table
32 16.7 million Blue, green, red and one extra byte, which some files use for transparency

BMP files with 8 bits or fewer point every pixel at an entry in the color table. BMP files with 16, 24 or 32 bits store the color itself. We also found 2-bit and 64-bit BMP files in the test set. ImageMagick, ffmpeg and Pillow refused both 2-bit BMP files, and all four readers refused the 64-bit file.

What Do 91 Test BMP Files Show? Four programs, 91 files and many disagreements

We read 91 BMP files in four programs. Ordinary BMP files opened everywhere. The 43 unusual BMP files split the programs: Chromium matched the right picture on 40 and ffmpeg on 15.

BMP files are simple, so you might expect every program to agree on them. We tested that with BMP Suite 2.8 by Jason Summers, a free set of 91 BMP files built to test programs. The suite's readme sorts them into good, questionable and bad folders, plus a few extras.

Good BMP files are ones a program should read if it claims to support BMP. Questionable BMP files are unusual or old. Bad BMP files are broken on purpose, and the readme asks only that a program does not crash on them. A refusal is not always a fault.

The four readers were Chromium 141, the engine inside Chrome and Edge, ImageMagick 6.9.12, ffmpeg 6.1.1 and Pillow 12.3.0, a Python library. We did not test Windows Photos, Paint, Mac Preview, Photoshop, GIMP or Paint.NET. Matched means every pixel is within 6 of 255 of the suite's own reference picture.

91 test files read
4 programs tried
27 good files drawn by Chromium
29 odd files with split answers

How the four programs read the 91 files

Results for the 91 BMP Suite files in four programs
Program Good drawn (of 27) Odd matched (of 43) Odd different Odd refused
Chromium 141 27 40 1 2
ImageMagick 6.9.12 27 19 16 8
ffmpeg 6.1.1 26 15 9 19
Pillow 12.3.0 26 18 5 20

Chromium refused 4 of the 20 bad BMP files, and the other three refused 7. All four refused badbitcount.bmp, badwidth.bmp and reallybig.bmp, a picture of 3,000,000 by 2,000,000 pixels. They disagreed on 29 of the 43 unusual BMP files. Only 12 of the 43 matched in all four.

Eleven BMP files that split the programs

How four programs read eleven unusual BMP Suite files
File What is unusual Chromium ImageMagick ffmpeg Pillow
pal2.bmp Two bits per pixel Right Refused Refused Refused
pal4rletrns.bmp 4-bit RLE with skipped pixels Right Different Different Different
pal8os2v2.bmp OS/2 version 2 header Right Different Right Right
pal1huffmsb.bmp Huffman compression from OS/2 Refused Refused Different Refused
rgb16-231.bmp 16 bits with odd color masks Right Different Refused Refused
rgb24png.bmp A PNG picture inside the BMP Right Right Refused Refused
rgb24jpeg.bmp A JPEG picture inside the BMP Right Right Refused Refused
rgb24rle24.bmp OS/2 24-bit RLE Right Refused Refused Refused
rgb32-111110.bmp 32 bits with 11-11-10 masks Right Right Refused Refused
rgba32abf.bmp Alpha bit fields Right Refused Refused Refused
rgba64.bmp Sixty-four bits per pixel Refused Refused Refused Refused

In the table, Right means the pixels matched the suite's reference picture. Different means the program drew a picture that did not match. Refused means it printed an error and drew nothing.

What the 91 results say about BMP files

One program is not enough Chromium alone matched 17 of the unusual BMP files, and 23 of the 43 were refused by at least one program. Try another program before you blame the BMP file.
Ordinary BMP files mostly agree All four programs drew 26 of the 27 good BMP files. ffmpeg and Pillow refused rgb32bf.bmp, a 32-bit file with bit masks.
A drawing can still be wrong Pillow drew the 4-bit RLE file pal4rle.bmp with 5,051 of 8,128 pixels off. ImageMagick drew 16 unusual files differently. A picture that appears is not always the right one.
Damaged BMP files get mixed answers Chromium drew our cut-short file shortfile.bmp, and the other three refused it. Chromium drew 16 of the 20 bad BMP files, and the others drew 13.

Which header do BMP writers use?

We also made BMP files, to see what programs write. We saved one 127 by 64 picture as BMP files with Pillow, ImageMagick and ffmpeg in 18 ways. The header size depended on the program and the option.

Header sizes and file sizes of BMP files saved by three programs
Program and option Header Compression File size
Pillow, 24 bits 40 bytes None 24,630 bytes
ffmpeg, bgr24 40 bytes None 24,630 bytes
ImageMagick, BMP3 40 bytes None 24,630 bytes
ImageMagick, default 124 bytes None 24,714 bytes
ImageMagick, BMP2 12 bytes None 24,602 bytes
Pillow, 1 bit 40 bytes None 1,086 bytes
ImageMagick, 1 bit 108 bytes None 1,154 bytes
ImageMagick, 64 colors 124 bytes RLE8 3,952 bytes
ffmpeg, rgb565 40 bytes Bit fields 16,450 bytes

ImageMagick, ffmpeg and Pillow opened all 18 BMP files. They drew the same pixels for 16 of them. On the two 16-bit BMP files the programs differed by 1 level out of 255, which looks like rounding. The default ImageMagick BMP file is 84 bytes bigger than the Pillow file with the same picture.

Read the results with care. These files came from one test suite, one set of program versions and one Linux machine. Real BMP files from cameras, scanners and old software may differ. The results show how programs behave, not how common any case is.

Repeat the check on your own file

The first bytes script reads any file you give it. The steps to open a BMP file list three free ways to see the picture.

What Does Our Expert Say About BMP Files? A note from Neeraj Singh on trying a second program

Read the first two bytes, try another program, then check the file size. A refusal from one program is not a verdict on the file.

Neeraj Singh

Expert insight

“Most BMP problems are not about the picture. The name is wrong, the header is rare or the file is huge. In our test, one program drew the right picture for 40 of 43 unusual files and another did it for only 15. So before you call a BMP file broken, read its first two bytes and try a second program.”

Neeraj Singh Manager, Tech Support & Operations 19+ years fixing Windows and system errors

What one refusal cannot show

Programs read BMP files by header kind. A program that refuses your BMP file may only lack one kind. In our test, Chromium matched 17 unusual BMP files that all three other programs missed.

So the first move costs nothing. Drag the BMP file into a Chrome or Edge window, which use the engine we tested. If a picture appears, the BMP file is fine and your first program is the problem.

Keep the original. If another program opens the BMP file, save a copy as PNG and keep the BMP as it was. A PNG keeps every pixel, and the steps to convert BMP files to PNG show how.

How Do You Open a BMP File? A browser, a photo app or Python

Open BMP files in a browser tab, a photo app or Python. Most programs read the common kinds, and another program usually reads the rare ones.

Double-click the BMP file first. If nothing happens or you see an error, use one of the routes below. The first bytes check shows whether the file is a BMP at all.

Open BMP files in Chrome or Edge

  1. Open a new tab in Chrome or Edge.
  2. Drag the BMP file onto the tab, or open it from the browser menu.
  3. Look at the picture. If it appears, the BMP file is fine and your first program is the problem.
  4. If you see an error or a blank page, read the five causes.

Chrome and Edge use the Chromium engine. We tested Chromium 141 itself. It drew all 27 good BMP files in the BMP Suite and matched the suite's picture on 40 of the 43 unusual ones.

Open BMP files with Python

Pillow is a free Python package. Install it with pip install pillow. The code below prints the size and color mode of the picture and shows it in your photo app.

Open BMP files with Pillow
from PIL import Image
img = Image.open("picture.bmp")
print(img.size, img.mode)
img.show()
The answer for one of our test files
(127, 64) RGB

ImageMagick reads the header from the command line. Its identify command printed BMP3, 127x64, 8-bit sRGB and 24630B for the same file. BMP3 is the name it gives to files with a 40-byte header.

Programs that open BMP files

Chrome and Edge Browsers Both use Chromium. We tested the engine, not the apps.
Microsoft Paint Windows FileInfo lists it as included with Windows. We did not test it.
Microsoft Photos Windows FILExt names it as the main program tied to BMP files. We did not test it.
Apple Preview Mac FileInfo lists it as included with macOS. We did not test it.
ImageMagick Command line Free. It drew all 27 good files, and we tested version 6.9.12.
Pillow Python A free package. We tested version 12.3.0.

FILExt also lists Photoshop, Paint Shop Pro, ACDSee, IrfanView, GIMP and XnView among programs for the type. We did not test any of them, so we say nothing about the BMP kinds they read.

Why Will a BMP File Not Open? Five causes, and only one of them is a damaged file

When a BMP file will not open, check the name, the header, the colors, the size and the damage. Only one check blames the BMP file.

Most failures are mismatches. The picture is fine, and the program does not fit it. Work through five checks before you look for another copy. The red check is the one where the BMP file itself is wrong.

The file is not a BMP Our renamed PNG, JPEG, GIF and WebP files opened in all four readers, because they look at the first bytes and not the name. Our text and ZIP files failed in every one. Use the two-byte check.
The header is a rare kind Chromium drew our 2-bit and OS/2 24-bit RLE files, and the other three refused them. Try a browser, then convert the file and keep the PNG.
The picture opens but looks wrong ImageMagick drew 16 unusual files differently, and Pillow drew one 4-bit RLE file with 5,051 of 8,128 pixels off. Compare the picture in another program.
The BMP file is damaged or cut short Our 273-byte shortfile.bmp is cut short. Chromium drew the 13 of 64 rows that exist and left 51 blank, and the other three refused it. Get another copy. See the test results.
The picture is too big Our reallybig.bmp is 24,630 bytes but claims 3,000,000 by 2,000,000 pixels. All four programs refused it. See why BMP files get so big.
A decision chart: if a BMP file will not open, check the name, the header kind, the colors, the damage and the picture size
Five symptoms and the first fix for every one. Only check 4 means the BMP file is damaged.

A five-step check

  1. Show file extensions and confirm the name ends in .bmp and not in .bmp.exe or .bmp.zip.
  2. Read the first two bytes. If they are not 42 4d, stop and read about other meanings of the ending.
  3. Compare the file size with the picture size. A 1920 by 1080 picture with 24 bits should be about 6.2 MB.
  4. Drag the BMP file into a Chrome or Edge tab. If a picture appears, the BMP file is fine.
  5. Convert the picture to PNG and keep the PNG, using the PNG conversion steps. If every program refuses the BMP file, get another copy.

Test with a second reader. Programs word the same problem differently, and they refuse different files. Our four readers disagreed on 29 of 43 unusual files. A BMP file that fails in one program should go through a second one before you give up.

How Do You Convert a BMP File to PNG or JPG? PNG keeps every pixel, and JPG does not

Convert BMP files to PNG with ImageMagick, ffmpeg or Pillow. PNG keeps every pixel, and JPG does not. All three programs gave back the same pixels in our test.

A converter converts. It reads the BMP file and writes a new file in another format, and your BMP stays as it was. Most people convert to shrink the file, and PNG does that with no loss.

Routes from BMP files to what you need
You want Route Status
A PNG file ImageMagick, ffmpeg or Pillow Tested, no pixel lost
A JPG file ImageMagick or Pillow with a quality setting Tested, pixels differ
A folder of PNG files ImageMagick mogrify Tested on two files
PNG, TIFF, GIF, WebP or PDF files A desktop converter Not tested

Convert BMP files to PNG

  1. Copy the BMP file and keep the original safe.
  2. Open a terminal in the folder with the file. Install ImageMagick, ffmpeg or Pillow first if you have none.
  3. Enter one command from the box below. Replace picture.bmp with your file name.
  4. Open picture.png and compare it with the BMP.
Convert BMP files to PNG files
convert picture.bmp picture.png            (ImageMagick 6, which we used. Version 7 uses magick.)
ffmpeg -i picture.bmp picture.png          (ffmpeg)
python -c "from PIL import Image; Image.open('picture.bmp').save('picture.png')"   (Pillow)

All three gave a PNG with the same pixels as the BMP. The largest difference was 0 out of 255. Saving the PNG back to BMP matched again in all three. Our PNG files were 1,220 bytes from ImageMagick, 14,650 from ffmpeg and 1,151 from Pillow, against 24,630 for the BMP. The picture is the same, and the encoders differ.

Convert BMP files to JPG

JPG throws away detail to save space. We saved the same picture at quality 90. In the ImageMagick JPG, 7,355 of the 8,128 pixels differed from the BMP, by up to 33 of 255. In the Pillow JPG, 7,656 differed, by up to 73. Use JPG for photos you will not edit again, and keep the BMP file or the PNG as your master.

Convert BMP files to JPG files
convert picture.bmp -quality 90 picture.jpg

Convert many BMP files at once

ImageMagick can convert a folder at once. The command below makes one PNG for every BMP file in the folder. We tried it on two BMP files.

Convert every BMP file in a folder to PNG
mogrify -format png *.bmp

Use a desktop converter

If you prefer a window to a command line, SysTools offers two Windows converters. We tested neither. What follows comes from their own pages.

SysTools BMP File Converter

Convert BMP files to PNG, JPEG, GIF, TIFF, WebP or PDF

Free demo

SysTools Image Converter

Convert BMP and other image types in bulk

Free demo

SysTools says the BMP File Converter previews files before it converts them, resizes pictures and works on single files or folders. Its demo converts the first 5 BMP files. The Image Converter page lists BMP among its inputs and says its trial also processes the first 5 files.

Be careful with upload sites. Online converters receive your picture. For private scans or photos, convert on your own computer.

Why Is a BMP File So Big? Width times height times three, plus 54 bytes

A 24-bit BMP file takes width times height times 3 bytes, with every row padded to a multiple of 4, plus 54 bytes of headers. That is 6,220,854 bytes for a 1920 by 1080 picture, whatever the picture shows.

Picture a screenshot filled with one flat color. As a BMP it is 6.2 MB. As a PNG it is 8.6 KB. A picture of random noise is 6.2 MB as a BMP and about the same as a PNG, because there is nothing to squeeze.

A bar chart of file sizes for a 1920 by 1080 picture. The BMP file is 6.2 MB for both a flat one-color picture and a noisy one. The PNG is 8.6 KB flat and 6.2 MB noisy. The JPG at quality 90 is 33 KB flat and 1.9 MB noisy
The BMP stays the same size. PNG and JPG shrink only what has patterns.

Same picture size, three formats

File sizes of one 1920 by 1080 picture saved as BMP, PNG and JPG
Format One flat color Random noise
BMP, 24 bits 6,220,854 bytes 6,220,854 bytes
PNG 8,596 bytes 6,230,646 bytes
JPG, quality 90 33,270 bytes 1,862,120 bytes

We made both pictures with Python and saved them with Pillow. The BMP file is the same size for both because it stores every pixel. PNG found patterns in the flat picture and almost none in the noise. JPG saved space on both and lost detail on the noise.

Size by resolution

Size of an uncompressed BMP file at common resolutions
Picture size 24 bits 32 bits 8 bits with 256 colors
640 by 480 921,654 bytes 1,228,854 bytes 308,278 bytes
1280 by 720 2,764,854 bytes 3,686,454 bytes 922,678 bytes
1920 by 1080 6,220,854 bytes 8,294,454 bytes 2,074,678 bytes
3840 by 2160 24,883,254 bytes 33,177,654 bytes 8,295,478 bytes
4000 by 3000 36,000,054 bytes 48,000,054 bytes 12,001,078 bytes

We worked these out with the formula, and our BMP files matched it. A 24-bit row of 1920 pixels is 5,760 bytes, and 1080 rows make 6,220,800. Add the 54 header bytes. A 32-bit file adds 4 bytes a pixel, and an 8-bit file adds a 1,024-byte color table.

How to make BMP files smaller

The best fix is a different format. Convert the file to PNG for no loss, or to JPG for photos. If you must stay with BMP, fewer bits help. Pillow saved our test picture as an 8-bit BMP of 8,502 bytes, against 24,630 for 24 bits, but it lost color detail.

Is It Safe To Open a BMP File? The picture is data, and the risk is the name

BMP files are pictures, not programs. The risk is the name: a file called photo.bmp.exe is a program, and FILExt lists EXE among the formats it found under the .bmp ending.

A real BMP file contains only a header and pixels, with no program inside. We did not test any reader for security flaws, so keep your photo apps up to date, as you would for any program that reads files from strangers.

What can go wrong

A fake ending Names like photo.bmp.exe end in .exe, so they are programs. Read the EXE program file guide and do not open them.
Another format in disguise FILExt lists PNG, ZIP, PDF, TIFF and PSD under the .bmp ending too. Our renamed ZIP file failed in every reader. The ZIP file guide shows how to open real archives.
A small file with a giant claim Our reallybig.bmp is 24,630 bytes, but its header asks for 3,000,000 by 2,000,000 pixels, which is about 18 TB. All four programs refused it.
A private picture Scans and screenshots can show names and numbers. Do not send them to unknown converter sites.

A safety check before you open it

  1. Show file extensions. A name that ends in .exe, .scr or .zip is not a picture.
  2. Check the source. A BMP file from your own scanner or screen is expected. One in an unexpected message needs care.
  3. Read the first two bytes. That step is safe, because nothing starts.
  4. Open the BMP file in an updated browser or photo app.
  5. If the file is not a BMP, find its real type from the first bytes and open it with the right program.
  6. Do not upload private pictures to websites. Convert them on your own computer.

Safe to read, careful to name. Reading two bytes is safe, and so is opening a real BMP file in an updated program. The danger is a file whose name lies about what it is.

How Does a BMP File Differ From PNG, JPG and GIF? Same pixels, different sizes

BMP stores every pixel as it is. PNG packs the same pixels with no loss, JPG packs them with some loss and GIF stores up to 256 colors. Choose the format by the job, not by the file ending.

The same picture can be stored in any of these files. The difference is how the pixels are stored. The table shows what every format does and what our 1920 by 1080 one-color picture came to in bytes.

BMP compared with PNG, JPG, GIF and PSD
Format How it stores pixels Our flat 1920 by 1080 picture Read more
BMP Every pixel as it is, usually with no compression 6,220,854 bytes This guide
PNG Compressed with no loss, so every pixel comes back 8,596 bytes See how PNG files work
JPG Compressed with some loss, so pixels differ 33,270 bytes at quality 90 See how JPG files work
GIF Up to 256 colors, with simple animation Not tested See how GIF files work
PSD Photoshop layers and settings in one file Not tested See how PSD files work

Converting BMP files to PNG kept every pixel in our test. Converting to JPG altered most of them, and a full-color picture saved as GIF can lose colors too. Keep a BMP file or PNG as your master copy.

Use BMP files when a program asks for raw pixels or an old tool reads nothing else. Use PNG for screenshots, logos and text. Use JPG for photos when file size matters more than exact pixels.

Wrong page? Windows icons that end in .ico are in the ICO file guide.

What Else Does the BMP Ending Mean? Boot logos, game palettes and files in disguise

Other things use the .bmp ending too. FILExt lists an Award BIOS boot logo, Infinity Engine palette data and an Apple Preview bitmap, and about one in four of its sampled files were another format.

If your .bmp file does not start with 42 4d, it may be none of the Windows bitmap kinds. FILExt lists the other meanings, and the table shows what it says.

Other things that use the BMP ending
Meaning What it is Where it comes from
Windows bitmap The picture format in this guide. FILExt puts it at 75 percent of its sample. Windows and OS/2
JPEG data A JPG picture with the .bmp name. FILExt puts these at 1 percent. Files saved with the wrong name
Award BIOS boot logo A logo embedded in a BIOS image and supplied by Phoenix, says FILExt BIOS images
Infinity Engine palette Palette data for the BioWare engine behind games like Baldur's Gate Game files
Apple Preview bitmap A bitmap format the Mac viewer supports, says FILExt Mac files
Device Dependent Bitmap An older Windows bitmap tied to a screen. FILExt lists it among the other formats. Older Windows versions
Other formats FILExt names PNG, ZIP, PDF, TIFF, PSD and EXE among the other 24 percent Files with the wrong ending

FileInfo describes only the Windows picture and lists no other meanings. The FILExt entry for the .bmp ending lists the rest. We could not check FILExt's counts ourselves, and we did not test the Award, Infinity or Apple kinds.

Our own renamed files back up the main point. A PNG, JPEG, GIF or WebP file with the .bmp name opened in all four readers, and a ZIP file did not. The first bytes show the real type.

What Is the BMP File Format Made Of? The specification facts we could check

A BMP file has a 14-byte file header, an information header whose size shows the version, an optional color table and padded pixel rows. It starts with 42 4d.

Specification facts for the BMP file format
Item What we could check
Maker Microsoft, as a format for Windows and OS/2, says the Library of Congress
Name Windows bitmap, also called the device independent bitmap or DIB, says FileInfo
Extensions .bmp and .dib, say Wikipedia
History The DIB arrived with Windows 3.0 in 1990. Version 4 headers came with Windows 95 and NT 4.0, and version 5 with Windows 98 and 2000.
Signature 42 4d, the letters BM. Some OS/2 files use other letters, including BA and CI.
File header 14 bytes: signature, file size, two reserved fields and the pixel offset
Information header 12, 16, 40, 52, 56, 64, 108 or 124 bytes in our test files, apart from one broken file. The size is the only version marker.
Compression 0 none, 1 RLE8, 2 RLE4, 3 bit fields, 4 JPEG, 5 PNG and 6 alpha bit fields. OS/2 version 2 uses 3 for Huffman and 4 for RLE24.
Bit depths 1, 2, 4, 8, 16, 24, 32 and 64 in our test files, apart from one broken file
Rows Padded to a multiple of 4 bytes. Stored bottom row first unless the height is negative.
Pixels 24-bit pixels are stored blue, green, red
Color profiles Version 5 headers add support for color profiles
Specification No standalone one. Microsoft documents the structures in its developer references.
Media types image/bmp and image/x-bmp. FILExt adds image/x-ms-bmp.

About the file signature

The first two bytes separate Windows BMP files from files that only borrow the name. Of our 91 BMP files, 90 start with 42 4d, and one OS/2 file starts with BA. We found no check beyond the letters, so a cut or edited BMP file still reads as a BMP file.

What we left out

We did not read Microsoft's source code or write a reader of our own. The layout above comes from Wikipedia, Microsoft Learn and the Library of Congress, and our own files agreed with it. We made no OS/2 BMP files.

We tested four readers: Chromium, ImageMagick, ffmpeg and Pillow. We did not use Windows Photos, Paint, Mac Preview, Photoshop, GIMP, Paint.NET, IrfanView or the SysTools converters. So we say nothing about those programs beyond what the cited pages state.

All 91 BMP files came from BMP Suite. None came from a camera, scanner or phone. We also did not test the Award, Infinity or Apple kinds, or check FILExt's counts.

Sources checked

For the format, the Wikipedia entry on the BMP file format, the Library of Congress format description and two pages from Microsoft: bitmap storage and the BITMAPINFOHEADER structure.

For the ending, the FileInfo entry for BMP files and the FILExt page. For the test files, BMP Suite 2.8. Every test count came from our own tests in October 2026.

Frequently Asked Questions About BMP Files

What is a BMP file?

A BMP file is a bitmap picture that stores every pixel one after another, usually with no compression. Microsoft made the format for Windows. It starts with the letters BM, which are the bytes 42 4d.

What does BMP stand for?

BMP stands for bitmap. Microsoft also calls the format a device independent bitmap, or DIB, and the .dib ending names the same format. A BMP file stores a color value for every pixel.

How do I open a BMP file?

Drag the file into a Chrome or Edge tab, or double-click it to open it in a photo app. Python opens it with the Pillow package. If nothing opens it, read the first two bytes to see whether it is a BMP at all.

What program opens a BMP file?

Chrome and Edge open BMP files, and FileInfo lists Microsoft Paint, Microsoft Photos and Apple Preview too. ImageMagick and the Pillow package open BMP files from code. We tested only Chromium, ImageMagick, ffmpeg and Pillow.

Why will my BMP file not open?

The name may be wrong, the header may be a rare kind, the colors may come out wrong, the file may be damaged or the picture may be too big. In our test, four readers disagreed on 29 of 43 unusual files, so try another program first.

How do I convert a BMP file to PNG?

Use ImageMagick with convert picture.bmp picture.png, or ffmpeg with -i picture.bmp picture.png. In our test, all three programs we tried gave back the same pixels, and the PNG was far smaller. Your BMP file stays as it was.

Is a BMP file better than JPG or PNG?

For most jobs it is not. A BMP file stores every pixel, so our 1920 by 1080 test picture took 6,220,854 bytes, against 8,596 bytes as a PNG when the picture was one flat color. JPG is smaller still for photos but loses some pixel detail.

Why are BMP files so big?

A BMP file stores every pixel with no compression. A 24-bit file takes width times height times 3 bytes, with every row padded to a multiple of 4, plus 54 bytes of headers. The picture content does not change the size.

Does a BMP file support transparency?

Some do. A 32-bit BMP file can store an alpha value, and version 4 and 5 headers can define one. Readers differ: on 4 unusual files, ImageMagick or ffmpeg drew the right colors but a different transparency.

Is a BMP file safe to open?

A real BMP file contains only a header and pixels, with no program inside. The risk is the name, because photo.bmp.exe is a program. Check the first two bytes, keep your photo apps updated and do not upload private pictures to converter sites.

What is the difference between BMP and PNG?

Both can store the same pixels. BMP stores them as they are, and PNG compresses them with no loss. In our test, the ImageMagick PNG gave back the exact BMP pixels and was 1,220 bytes against 24,630 for the BMP.

Is every .bmp file a Windows bitmap?

No. FILExt says about 24 percent of the .bmp files it sampled were other formats, and 1 percent stored JPEG data. Some are PNG, ZIP, PDF, TIFF or PSD files with the wrong ending. A Windows BMP starts with 42 4d.

Still Stuck With a BMP File? Eight routes out, depending on what went wrong

Your BMP file will not open

Start with the five checks. The name, the header kind and another program explain most cases.

You need a smaller or different file

Go to the conversion commands. One command makes PNG files with the same pixels.

Is your picture a photo that ends in .jpg? The JPG photo guide covers it.

Is it a PNG picture with transparency? The PNG picture guide explains it.

Is it an animated picture that ends in .gif? The GIF animation guide shows how to open it.

Is it a layered Photoshop file? Read the Photoshop PSD guide.

Not sure the file is a BMP at all? Compare its first bytes with the format reference, then see what 91 test BMP files show.

Is it a file type you do not know? Browse the file extension resource library, or send it to us on the submit a file type page.