User Rating 0.0
Total Usage 0 times
No input
Presets:
Preview
Enter binary values and click Convert
Is this tool helpful?

Your feedback helps us improve.

About

A bitmap image at its most fundamental level is a grid of binary pixel states. This tool performs direct conversion from raw binary values (0 and 1) into a valid BMP file conforming to the Windows BITMAPINFOHEADER specification. Each 1 maps to a foreground pixel and each 0 maps to a background pixel. The output is a genuine 24-bit uncompressed BMP file constructed byte-by-byte in the browser, not a screenshot or canvas export. Incorrect row padding or inverted scanline order will produce a corrupted file that image viewers reject. This tool handles the padding calculation (rows must align to 4-byte boundaries) and bottom-up row ordering automatically.

Use cases include QR code prototyping, sprite design, font glyph creation, and visualizing binary data streams from embedded systems or memory dumps. The tool approximates ideal conversion assuming a rectangular grid. If your input rows have unequal lengths, shorter rows are right-padded with 0. Maximum supported resolution is 1024×1024 pixels. Pro tip: paste raw binary output from microcontroller UART logs directly. The parser strips common delimiters (commas, spaces, pipes) automatically.

binary to bitmap bmp converter binary image pixel art bitmap generator binary grid bmp file creator

Formulas

The BMP file size is computed from the image dimensions and the 24-bit pixel format. Each pixel occupies 3 bytes (BGR). Each row must be padded to a 4-byte boundary.

padding = (4 (W × 3) mod 4) mod 4
rowSize = W × 3 + padding
pixelDataSize = rowSize × H
fileSize = 54 + pixelDataSize

Where W = image width in pixels, H = image height in pixels. The constant 54 is the combined header size (14-byte file header + 40-byte DIB header). Scanlines are stored bottom-to-top: the first row in the pixel data block corresponds to the bottom row of the displayed image. Each pixel is stored in BGR order (blue byte first, then green, then red), not RGB.

Reference Data

BMP FieldOffset (bytes)Size (bytes)Value / Description
Signature020x42 0x4D ("BM")
File Size24Total bytes: header + pixel data
Reserved640x00000000
Pixel Data Offset10454 (14 + 40)
DIB Header Size14440 (BITMAPINFOHEADER)
Image Width184Pixels (signed 32-bit)
Image Height224Pixels (positive = bottom-up)
Color Planes2621
Bits Per Pixel28224 (RGB, no alpha)
Compression3040 (BI_RGB, uncompressed)
Image Data Size344rows × (width × 3 + padding)
H Resolution3842835 px/m (~72 DPI)
V Resolution4242835 px/m (~72 DPI)
Colors Used4640 (all colors)
Important Colors5040
Row Padding - 0-3(4 (w × 3) mod 4) mod 4
Pixel Order - - BGR (Blue, Green, Red) per pixel
Scanline Order - - Bottom row first (inverted)
Max Width (this tool) - - 1024 pixels
Max Height (this tool) - - 1024 pixels
Typical 8×8 File Size - - 250 bytes
Typical 32×32 File Size - - 3,126 bytes
Typical 256×256 File Size - - 196,662 bytes

Frequently Asked Questions

The BMP specification inherits alignment requirements from Windows GDI (Graphics Device Interface). Memory-aligned rows enable faster blitting operations on x86 architectures where DWORD (4-byte) aligned reads are significantly faster. The padding bytes are always 0x00. For a width of 5 pixels at 24-bit depth, each row uses 15 bytes of pixel data, padded to 16 bytes (1 byte padding).
The converter determines the maximum row length across all input rows and uses that as the image width W. Shorter rows are right-padded with 0 values (background color). This means missing bits on the right side of shorter rows appear as background pixels. To avoid unintended results, ensure all rows contain the same number of binary digits.
Yes. The parser accepts multiple delimiter formats: spaces, commas, semicolons, pipes, and newlines. A typical UART dump like 1,0,1,1,0,0,1,0 per line is parsed correctly. Strip any non-binary preamble (timestamps, addresses) before pasting. The tool ignores all characters except 0, 1, and delimiter characters.
This is a legacy of the Windows GDI and Intel's little-endian architecture. When a 32-bit color value 0x00RRGGBB is stored in little-endian memory, the bytes appear as BB GG RR 00. The 24-bit BMP format simply drops the alpha byte, leaving BGR order. Every BMP reader expects this convention.
The tool caps input at 1024×1024 pixels (1,048,576 binary values). At 24-bit depth with padding, this produces a file up to approximately 3.1 MB. The BMP encoding runs synchronously in the browser and completes in under 200 ms for grids up to this size on modern hardware. For larger images, consider a server-side solution.
Yes. The tool provides color pickers for both the 1-bit (foreground) and 0-bit (background) colors. These hex colors are converted to BGR byte triplets during BMP encoding. The default is black foreground (#000000) on white background (#FFFFFF).
The first row you type in the input becomes the top row of the displayed image. Internally, the encoder reverses row order so the last input row is written first into the BMP pixel data block. This inversion is handled automatically. If you open the raw BMP bytes in a hex editor, the bottom row of the image appears first after offset 54.