BMP to PNG Converter

Parses a Windows BMP file's own byte layout — the BITMAPFILEHEADER, its DIB header (BITMAPINFOHEADER or the newer V4/V5 variants), an optional color palette, and the pixel array — and decodes 8-bit indexed, 24-bit RGB, or 32-bit RGB/RGBA pixels into a PNG you can preview and download, entirely client-side. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

BMP is Windows' native uncompressed bitmap format — simple to decode but rarely web-friendly, since browsers display it inconsistently and files are much larger than an equivalent PNG.

This tool reads a BMP's raw bytes directly and re-encodes the pixels as a standard PNG you can use anywhere.

What Is BMP to PNG Converter?

A byte-level BMP decoder that parses the file header, DIB header, optional palette, and pixel array by hand, without relying on the browser's built-in image decoders (which don't universally support BMP).

It hands the decoded pixels to a canvas for PNG re-encoding and download.

How BMP to PNG Converter Works

The tool reads the 14-byte BITMAPFILEHEADER for the pixel data offset, then the DIB header for width, height, bit depth, and compression method, following whichever header size is present (40, 108, or 124 bytes) since the first 40 bytes are laid out identically across all of them.

For 32-bit bitmaps it extracts each RGBA channel using the bitfield color masks (or assumes standard BGRA order for uncompressed 32-bit); for 8-bit it looks up each pixel's index in the attached color palette.

When To Use BMP to PNG Converter

Use it when you have a legacy BMP screenshot, icon export, or scanned image and need a properly compressed, universally supported PNG instead.

It's also useful for verifying exactly what a BMP file contains, since the decoder surfaces a clear error if the file uses an unsupported compression mode or bit depth rather than silently failing.

Features

Advantages

  • Runs entirely client-side; the uploaded BMP is never sent to a server.
  • Supports both the classic and modern (V4/V5) DIB header variants, plus indexed, 24-bit, and 32-bit-with-alpha pixel formats.
  • Losslessly round-trips 32-bit BMPs produced by this tool set's own PNG-to-BMP converter.

Limitations

  • RLE-compressed BMPs (BI_RLE4/BI_RLE8) and 1-bit or 16-bit-per-pixel BMPs aren't supported and are rejected with a clear error.
  • 32-bit BMPs without explicit BI_BITFIELDS masks are assumed to carry no meaningful alpha (treated as fully opaque), matching how most encoders that don't set bitfields intend the 4th byte to be used.

Examples

24-bit screenshot

Input

A 1024x768 24-bit uncompressed BMP screenshot

Output

A pixel-identical PNG, typically a fraction of the BMP's file size

24-bit BMP has no alpha channel, so the PNG output is fully opaque.

32-bit icon export with alpha

Input

A 256x256 32-bit BMP with BI_BITFIELDS alpha masks

Output

A PNG with the exact same per-pixel transparency

The bitfield masks are read directly to extract true alpha values.

Best Practices & Notes

Best Practices

  • Re-save BMPs as PNG for anything destined for the web — PNG compresses far better and every browser supports it consistently.
  • If a BMP fails to decode, check whether it was saved with RLE compression; re-export it as uncompressed BMP first if so.

Developer Notes

The decoder is a pure function operating on a Uint8Array with a DataView for multi-byte reads, sharing its bitfield-mask math with png-to-bmp-converter's encoder so 32-bit round trips are exact; only the surrounding component touches an actual <canvas> to paint and download the result.

BMP to PNG Converter Use Cases

  • Converting a legacy Windows BMP screenshot to PNG for web use
  • Re-encoding a BMP-format icon export into a smaller, more compatible PNG
  • Recovering pixel data from an old BMP asset for reuse in a modern pipeline

Common Mistakes

  • Assuming every BMP will decode — RLE-compressed and low-bit-depth BMPs are real, common variants this tool doesn't support.
  • Expecting a 24-bit BMP to produce a PNG with transparency; 24-bit BMP has no alpha channel at all.

Tips

  • If you control how the BMP was created, export it as 32-bit with alpha to preserve transparency through the conversion.
  • Use the dimensions finder afterward to confirm the decoded PNG's size matches what you expected.

References

Frequently Asked Questions