BMP to Base64
Drop a BMP and get a Base64 data URI you can paste straight into HTML or CSS. Everything runs in your browser — the file is never uploaded.
How to convert a BMP to Base64
Drag a BMP onto the drop zone above (or click to browse). The tool reads it locally with the browser's FileReader API and produces a data URI — a string of the form data:image/bmp;base64,Qk… that embeds the whole image inline. Click Copy, then paste it where you need it. Use the Raw Base64 toggle if you want only the encoded payload without the data: prefix.
When to inline a BMP as a data URI
BMP is a lossless, uncompressed format — every pixel is stored raw — so bitmaps are large before you even encode them. That makes them a poor fit for inlining. The tradeoffs:
- Size: BMP is uncompressed, and Base64 adds another ~33% on top. A raw bitmap becomes a very long data URI fast.
- Better formats: Convert the bitmap to PNG (lossless) or WebP (smaller) first — you'll get a fraction of the byte count for the same pixels.
- Rule of thumb: only inline a BMP for a tiny icon where the extra bytes don't matter; otherwise compress it first or keep it as a normal file.
Tip: if you control the asset, re-export it as PNG or WebP before encoding — the resulting data URI is usually many times smaller than an inlined BMP.
Using the data URI in HTML and CSS
In HTML, drop it into an <img> src:
<img src="data:image/bmp;base64,Qk2eAAAAAAAAADYAAAAo..." alt="bitmap">
In CSS, use it as a background-image:
.bitmap {
background-image: url("data:image/bmp;base64,Qk2eAAAAAAAAADYAAAAo...");
}
Is this private?
Yes. The conversion happens entirely client-side in JavaScript. Your BMP is read into memory in the browser and encoded locally — it is never sent to a server. You can confirm this by opening DevTools → Network: adding a BMP fires no upload request.
Frequently asked questions
How do I convert a BMP to Base64?
Drop the BMP onto the converter at the top of this page. It outputs a data URI like data:image/bmp;base64,Qk… that you can paste into an <img> src or a CSS url().
Does converting a BMP to Base64 increase its size?
Yes — twice over. BMP is already uncompressed, and Base64 adds another ~33% because it represents every 3 bytes with 4 ASCII characters. Compressing to PNG or WebP first gives a much smaller result.
Should I inline a BMP as a Base64 data URI?
Rarely. Convert the bitmap to PNG or WebP first, then inline that — an uncompressed BMP produces a needlessly large data URI. Inlining a raw BMP only makes sense for a tiny icon.
How do I go the other way (Base64 back to a BMP)?
Use the Base64 to BMP tool to decode a data URI or raw Base64 back into a viewable, downloadable BMP.
Need other formats?
The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.
Open base64.dev →