Tools

Home
Base64 Encode/DecodeString to HexHash GeneratorUTF-8 Encode/DecodeURL Encode/Decode

Convert Bitmap To Byte Array Online

Convert Bitmap To Byte Array online. All processing happens in your browser.

Your files never leave your browser
No image loaded
INPUT
🖼

Drop image here or click to upload

Max 50MB • 100% Private

OUTPUT
Ready

Drop a bitmap and get a byte array ready to paste into your microcontroller code — C array, Arduino PROGMEM, or raw hex. And everything runs in your browser. Nothing gets uploaded.

How It Works

Upload Bitmap
➔
Read Pixel Data
➔
Generate Byte Array

Your image gets drawn onto an HTML canvas, which exposes every pixel as RGBA values. The tool reads those values row by row, converts them to the byte format you picked, and wraps the result in valid code syntax. For monochrome output, each pixel is thresholded to 0 or 1 and packed into 8-bit chunks — exactly what most embedded displays expect.

Examples

Arduino OLED Logo

Displaying a 16x16 icon on an SSD1306 OLED screen connected to an Arduino Nano.

INPUT
16x16 BMP icon (black wifi symbol on white)
OUTPUT
const unsigned char PROGMEM icon[] = { 0xFF, 0xFF, 0xE0, 0x07, 0xC7, 0xE3, 0xFC, 0x3F, 0xF1, 0x8F, 0xFE, 0x7F, 0xFC, 0x3F, 0xFE, 0x7F, ... };

Embedded Splash Screen for STM32

A 128x64 monochrome bitmap for a product boot screen stored in flash memory.

INPUT
128x64 BMP splash screen (company logo, monochrome)
OUTPUT
const uint8_t splash[1024] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFC, 0x00, 0x01, 0xFF, 0xFF, 0x80, // ...1024 bytes total };

Raw Hex Dump for Custom Protocol

Sending a small 8x8 sprite over a serial link as raw bytes — no C wrapper needed, just the hex values.

INPUT
8x8 PNG sprite (simple arrow icon)
OUTPUT
18 3C 7E FF 18 18 18 00

Who Uses This

🔧 Embedded Engineers

Turning icons and UI graphics into flash-ready arrays for STM32, ESP32, and PIC projects.

🤖 Arduino Hobbyists

Getting bitmaps onto OLED and LCD shields without installing desktop conversion tools.

🎮 Game Developers

Extracting sprite data for retro consoles and custom game engines that read raw pixel buffers.

🎓 CS Students

Learning how images are stored in memory by seeing the actual byte representation of their files.

Common Mistakes

Using a color image for a monochrome display

The array will be much larger than expected, and the display driver won't know what to do with RGB data. Convert your image to 1-bit black and white before processing, or use the monochrome output option.

Wrong image dimensions for the target screen

A 130x65 image won't map cleanly to a 128x64 OLED. Resize your bitmap to match the exact display resolution first — off-by-one pixels mean garbled output on hardware.

Forgetting byte order matters

Some displays read pixels left-to-right with MSB first, others expect LSB first. If your image shows up mirrored or scrambled, check your display driver's expected bit order and pick the matching option here.

Technical Details

Frequently Asked Questions

How do I convert a BMP image to a byte array for Arduino?

Upload your BMP file here, select the Arduino PROGMEM format, and hit Process. Copy the generated array and paste it into your sketch. Make sure the image dimensions match your display — most Arduino OLEDs are 128x64 or 128x32 pixels.

What is a bitmap byte array?

It is the raw pixel data of an image stored as a list of numbers (bytes). Each byte represents pixel brightness or on/off state. Embedded systems and microcontrollers read these arrays directly to show images on screens, since they can't decode PNG or JPEG files.

Can I use PNG or JPG instead of BMP?

Yes. The tool accepts any image format your browser supports — PNG, JPG, GIF, WebP, and BMP all work. The format of the source file doesn't affect the byte array output since the browser decodes the image to raw pixels before conversion.

Does this tool upload my image to a server?

No. The entire conversion runs in your browser using the Canvas API. Your image data never leaves your machine. You can even disconnect from the internet after loading the page and it'll still work.

How do I display a byte array on an SSD1306 OLED?

Generate the array here using monochrome output, then use the Adafruit SSD1306 library's drawBitmap() function. Pass in the x/y position, the array name, width, height, and color. The array must match your display resolution or the image will look scrambled.

Share: