Home

SSD1306 Bitmap Generator

Convert images to Adafruit GFX drawBitmap code for 0.96" and 0.91" SSD1306 displays - no upload, no signup.

Guide

The SSD1306 is the chip inside the popular 0.96in 128x64 and 0.91in 128x32 OLED modules. The Adafruit SSD1306 library draws images with drawBitmap(), which expects a byte array in flash where each byte holds 8 horizontal pixels, left pixel in the highest bit. This generator creates exactly that format from any image - PNG, JPG, BMP, WebP, or GIF - plus a complete sketch with the display set up at I2C address 0x3C. If your 1.3in module shows garbage, it is probably not an SSD1306 at all: most 1.3in 128x64 modules use the SH1106 chip, which needs the SH110X library or U8g2 instead. Choose the right display here, and the code will match it.

ESP32 Flash Check

Rectangles: 3536 B · Rects + lines: 2626 B · Run-length: 3220 B · Bitmap: 4096 B

Uses 0.2% of the ESP32's 1.25 MB app space flash. Sizes are image data plus any extra drawing code each method needs (measured on Arduino Uno; the display library itself is not counted). ✓ Output checked pixel-for-pixel against your bitmap.

As bitmap 4,096 B 8 × 64x64
Rects + lines (auto) 2,626 B 308 rects + 292 lines · incl. ~190 B code
Memory saved
1,470 B 35.9%

Input Bitmap Code

ESP32

Arduino code (.ino .h .c .cpp .xbm), images (PNG JPG BMP WebP) or an animated GIF. Select several images to make an animation, or drop files here.

Image size (px)
×
Position on screen
X Y

OLED Live Preview

0 Frames
0.96" 128x64 SSD1306
FPS: 15 I2C 0x3C
Playback
15 FPS
Frames Frame 0 / 0
No frames yet

Arduino Code

// Paste bitmap code and press Convert.

Make SSD1306 bitmaps for the Adafruit library

The SSD1306 is the chip inside the popular 0.96" 128x64 and 0.91" 128x32 OLED modules. The Adafruit SSD1306 library draws images with drawBitmap(), which expects a byte array in flash where each byte holds 8 horizontal pixels, left pixel in the highest bit. This generator creates exactly that format from any image, plus a complete sketch with the display set up at I2C address 0x3C.

Diagram showing how Adafruit drawBitmap packs 8 horizontal SSD1306 pixels into one byte, most-significant-bit first
Adafruit drawBitmap byte packing: 8 horizontal pixels per byte, Most Significant Bit (MSB, Bit 7) on the left.

Example: drawing the generated bitmap

display.clearDisplay();
display.drawBitmap(0, 0, logo, 128, 64, SSD1306_WHITE);
display.display();

For complete wiring schematics, library installation steps, and a multi-sensor sketch, read our full Arduino SSD1306 Display Tutorial.

Why is my image scrambled, mirrored or shifted?

Symptom Likely cause Fix
Image mirrored in 8-pixel strips Array is XBM (LSB-first) used with drawBitmap (MSB-first) Re-convert for Adafruit, or use drawXBMP with U8g2
Image scrambled / noisy Wrong canvas size, or vertical byte order Set canvas to display size (128x64 or 128x32), horizontal byte order
Noisy screen, or image shifted 2 pixels (1.3in module) Module is SH1106, not SSD1306 Choose 1.3in SH1106 display; code uses SH110X or U8g2
Screen stays blank Wrong I2C address, or display not found Most modules use 0x3C; some 128x64 boards use 0x3D - see note in generated code
"SSD1306 allocation failed" Not enough RAM for full buffer Use U8g2 page mode, or a board with more RAM (ESP32)

Visit our dedicated OLED Troubleshooting Hub for step-by-step diagnostic checklists. If you have a 1.3" module, read SH1106 vs SSD1306 first.

Generate an SSD1306 bitmap in four steps

  1. Upload a PNG, JPG, BMP, WebP or GIF, or paste an existing array.
  2. Choose 0.96" 128x64 or 0.91" 128x32 SSD1306 and your board.
  3. Set the brightness cut-off and invert so the preview looks right.
  4. Copy the code. Pick "Keep as bitmap" for a classic drawBitmap array, or Auto for the smallest code.

Smaller than a bitmap: vector drawing code

A normal OLED bitmap stores every pixel: a full 128x64 screen is always 1,024 bytes. Most OLED graphics are outlines, icons and simple shapes, which take far less space as drawing commands (fillRect, drawLine). Auto mode tests every method and picks the smallest. See real benchmarks in our vector code flash guide.

Supported OLED displays and boards

In addition to 0.96" and 0.91" SSD1306 displays, this generator supports 1.3" SH1106, 1.5" SH1107/SSD1327, and 0.66" Wemos shields on Arduino Uno, Nano, ESP32, ESP8266, and Raspberry Pi Pico. See the complete compatibility table on our homepage.

Frequently asked questions

What bitmap format does Adafruit drawBitmap expect?

A 1-bit array stored in PROGMEM, read row by row. Each byte holds 8 horizontal pixels with the leftmost pixel in the most significant bit, and each row is padded to whole bytes: (width + 7) / 8 bytes per row.

What is the I2C address of an SSD1306 OLED?

Most modules use 0x3C. Some 128x64 boards are set to 0x3D. The generated code uses 0x3C and notes where to change it if the screen stays blank.

Why does my 1.3 inch OLED show garbage with the SSD1306 library?

Most 1.3in 128x64 modules use the SH1106 chip, not the SSD1306. Choose the 1.3in SH1106 display in the converter; the code then uses the Adafruit SH110X library, or U8g2.

Will a 128x64 image fit on an Arduino Uno?

Yes. The image is stored in flash (1,024 bytes for a full screen), but the Adafruit library also needs 1 KB of the Uno's 2 KB RAM for the screen buffer, so keep the rest of your sketch light or use U8g2 page mode.

Are my images uploaded to a server?

No. The converter runs entirely in your web browser. Your images, GIFs, and code never leave your computer.

OLED Guides & Tutorials

More OLED converters