BMP to Base64
Convert BMP to Base64 online and use it as a generator, which provides ready-made examples for data URI, img src, CSS background-url, and others. The BMP to Base64 converter is identical to Image to Base64, with the only difference that it forces the mime type to be “image/bmp” (even if the uploaded file has a different content type or it cannot be detected). Please note that the BMP to Base64 encoder accepts any images types with a size of up to 50 MB. If you are looking for the reverse process, check Base64 to BMP.
About BMP
- Name: Bitmap Picture
- Developer: Microsoft
- MIME types: image/bmp, image/x-bmp
- File Extensions: .bmp, .dib, .rle
- Uniform Type Identifier: com.microsoft.bmp
- Type of Format: Raster graphics
Output formats
If you do not know what output format you need, check the following examples to see how will look the result of the same Base64-encoded BMP image formatted in each of the available formats (as an example image I use a one-pixel red dot BMP file):
• Plain text:Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==
• Data URI:data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==
• CSS Background Image:.base64 {
background-image: url("data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==")
}
• HTML Favicon:<link rel="shortcut icon" href="data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==" />
• HTML Hyperlink:<a href="data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA=="></a>
• HTML Image:<img alt="" src="data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==" />
• HTML Iframe:<iframe src="data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==">
The “iframe” tag is not supported by your browser.
</iframe>
• JavaScript Image:var img = new Image();
img.src = "data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==";
document.body.appendChild(img);
• JavaScript Popup:window.onclick = function () {
this.open("data:image/bmp;base64,Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==");
};
• JSON:{
"image": {
"mime": "image/bmp",
"data": "Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA=="
}
}
• XML:<?xml version="1.0" encoding="UTF-8"?>
<root>
<image mime="image/bmp">Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADEDgAAxA4AAAAAAAAAAAAAAgD+AA==</image>
</root>
If I missed an important output format for Base64-encoded BMP images, please let me know — I would love to implement it.