BMP to Base64

Encode BMP bitmap images as Base64 strings.

Drag & drop a file here, or click to browse

Drop a BMP file here. Max 10 MB, converted in your browser.

BMP to Base64 Converter

Convert a Windows bitmap (.bmp) into a Base64 string or a data:image/bmp;base64,... URI directly in your browser. Drop the file above to see a preview, the file size versus the encoded size, and copy-ready snippets for HTML, JSON, CSS, and Markdown.

A short history of BMP

BMP, also called DIB (device-independent bitmap), dates back to Windows 2.0 and OS/2 in the late 1980s. It stores pixels more or less the way graphics memory does: a small header with width, height, and bit depth, an optional color table, and then the rows of pixels, usually bottom-up. It supports 1, 4, 8, 16, 24, and 32 bits per pixel. Optional RLE compression exists for 4- and 8-bit images, but almost every BMP you encounter is uncompressed. Newer header versions (BITMAPV4/V5) can carry an alpha channel, although support for BMP transparency varies between programs. There is no animation.

What you'll see in the output

The data URI begins with data:image/bmp;base64,Qk. The Qk comes from the BM magic bytes at the start of every bitmap. Right after that, the next characters encode the total file size stored in the header.

Why BMP is rarely inlined

Because the pixels are stored raw, a BMP data URI is huge compared to other formats. A simple 64×64 icon at 32 bits is 16 KB of pixel data plus the header — the same icon as PNG might be 1–2 KB. For the web, convert BMP to PNG first and use PNG to Base64.

When BMP to Base64 is still useful

  • Legacy Windows applications, embedded devices, and thermal printers that only accept bitmaps.
  • Test data for image decoders and parsers, where a simple predictable format is an advantage.
  • Transferring a screenshot captured by native code (e.g. via the Windows clipboard) through a JSON API.
  • Game modding and retro projects that expect raw sprites.

To turn a Base64 bitmap back into a file, paste it into Base64 to Image; for other formats, use the general Image to Base64 tool.

Frequently Asked Questions

Yes. Chrome, Edge, Firefox, and Safari all decode BMP images, so data:image/bmp;base64,... works in an <img> tag. Some email clients and older tools don't, which is another reason to prefer PNG for anything you publish.

Most BMP files are uncompressed: a 500×500 image at 24 bits per pixel is about 750 KB, which becomes roughly 1 MB of Base64 text. Converting the same image to PNG usually makes it 5–20 times smaller before encoding.

BMP files start with the two ASCII letters BM (bytes 42 4D). In Base64 that becomes Qk, so a string starting with Qk followed by a few more characters is almost always a Windows bitmap.