Home
OLED Bitmap Converter

Image, GIF or byte array to Arduino code for SSD1306, SH1106 & U8g2 OLED displays

Home / Guides / SH1106 vs SSD1306
Hardware Comparison

SH1106 vs SSD1306: Which OLED Do You Actually Have?

Most 0.96-inch 128x64 OLED modules use the SSD1306 chip and most 1.3-inch modules use the SH1106. They look alike and have the same four pins and I2C address, but they are not code-compatible: the SH1106 has 132 columns of memory instead of 128, and none of the SSD1306's extra memory modes. Use the driver made for your chip and both work well.

By Bilal Ramzan · Updated 29 October 2026 · Code examples compiled for Arduino Uno

SH1106 vs SSD1306 at a glance

SSD1306SH1106
Typical module0.96" 128x64, also 0.91" 128x321.3" 128x64
Display memory128 x 64 pixels132 x 64 pixels; the glass shows columns 2-129 on most 1.3" modules
Memory addressing modesPage, horizontal and verticalPage only
Panel powerBuilt-in charge pump, switched on with command 0x8DDC-DC converter, switched on with commands 0xAD and 0x8B
Hardware scrollingYes, horizontal and diagonal scroll commandsNo horizontal scroll (only a start-line offset)
I2C address0x3C on most modules, 0x3D on some0x3C on most modules, 0x3D on some
I2C speedUp to 400 kHzUp to 400 kHz
Adafruit libraryAdafruit_SSD1306Adafruit_SH110X (class Adafruit_SH1106G)
U8g2 constructorU8G2_SSD1306_128X64_NONAME_F_HW_I2CU8G2_SH1106_128X64_NONAME_F_HW_I2C
Image dataThe same on both: drawBitmap arrays (Adafruit) or XBM arrays (U8g2)

Chip facts from the SSD1306 datasheet (Solomon Systech) and the SH1106 datasheet (Sino Wealth). Library facts from the Adafruit SSD1306 2.5.17, Adafruit SH110X 2.1.15 and U8g2 2.37.1 source code.

Why SSD1306 code does not work on an SH1106

Diagram: the SSD1306 has 128 columns of memory, all visible; the SH1106 has 132 columns and the glass shows columns 2 to 129
The SH1106 keeps 2 hidden columns on each side of the visible 128.

There are two differences that matter:

  1. 132 columns instead of 128. The SH1106's memory is 132 pixels wide, and on almost every 1.3" module the glass shows columns 2 to 129. Code written for the SSD1306 starts at column 0, so the picture lands 2 pixels too far left.
  2. No horizontal memory mode. The Adafruit SSD1306 library switches the chip into horizontal addressing mode and then sends all 1,024 bytes of the screen in one stream; the SSD1306 moves to the next row by itself. The SH1106 only has page addressing, so it does not move on, and most of the picture ends up in the wrong place.

U8g2 sends each 8-pixel row of the screen separately with its own address, so its SSD1306 and SH1106 drivers differ only by that 2-column offset. That is why U8g2 code on the wrong chip is shifted, while Adafruit SSD1306 code on an SH1106 is garbled.

What you see with the wrong driver

Code you runYour moduleWhat you seeWhy
Adafruit_SSD1306SH1106Random noise, or a garbled pictureIt uses horizontal addressing mode, which the SH1106 does not have
U8g2 SSD1306 constructorSH1106Picture shifted 2 pixels left, a strip of random pixels down the right edgeData starts at memory column 0, but the glass starts at column 2
Adafruit_SH1106GSSD1306Often a dark screenIts setup never sends 0x8D, so the SSD1306's charge pump stays off
U8g2 SH1106 constructorSSD1306Picture shifted 2 pixels rightIt adds the SH1106's 2-column offset (and does turn the charge pump on)

These follow from how each library talks to the chip, which we checked in their source code. If your screen does something different, tell us and we will add it.

How to tell which chip you have

  1. Look at the size. 0.96" 128x64 and 0.91" 128x32 modules almost always use the SSD1306. 1.3" 128x64 modules usually use the SH1106, although some 1.3" modules are sold with an SSD1306.
  2. Read the listing. The chip sits under the glass, so you cannot read its marking. The seller's title or description usually names it.
  3. Run the frame test below. It draws a 1-pixel border with U8g2's SSD1306 driver. A complete border means SSD1306. A missing left edge with a noisy strip on the right means SH1106.
  4. Confirm with the right driver. If you think it is an SH1106, run the SH1106 example further down. A clean, centred picture confirms it.

Install U8g2 from the Arduino Library Manager, then upload this sketch (it compiles for an Arduino Uno in 9,662 bytes):

// Which chip is my 128x64 OLED? Draws a 1-pixel frame with the SSD1306 driver.
// SSD1306: you see a complete frame.
// SH1106:  the left edge of the frame is missing and a thin strip of
//          random pixels appears on the right edge.
#include <Wire.h>
#include <U8g2lib.h>
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);

void setup() {
  u8g2.begin();
  u8g2.clearBuffer();
  u8g2.drawFrame(0, 0, 128, 64);          // 1-pixel border around the screen
  u8g2.setFont(u8g2_font_6x10_tr);
  u8g2.drawStr(8, 36, "Check the left edge");
  u8g2.sendBuffer();
}

void loop() {}

Code for each chip

Adafruit libraries

For an SSD1306 you need Adafruit SSD1306. For an SH1106, install Adafruit SH110X instead. The drawing functions are the same; four lines change:

SSD1306SH1106
Include#include <Adafruit_SSD1306.h>#include <Adafruit_SH110X.h>
Display objectAdafruit_SSD1306 display(128, 64, &Wire, -1);Adafruit_SH1106G display(128, 64, &Wire, -1);
Startdisplay.begin(SSD1306_SWITCHCAPVCC, 0x3C)display.begin(0x3C, true)
ColourSSD1306_WHITESH110X_WHITE

A complete SH1106 sketch (compiles for an Arduino Uno in 11,960 bytes):

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
Adafruit_SH1106G display(128, 64, &Wire, -1);
void setup() {
  if (!display.begin(0x3C, true)) { for (;;); }   // true = reset the display
  display.clearDisplay();
  display.drawRect(0, 0, 128, 64, SH110X_WHITE);
  display.setTextSize(1);
  display.setTextColor(SH110X_WHITE);
  display.setCursor(10, 28);
  display.print("SH1106 OK");
  display.display();
}
void loop() {}

U8g2

With U8g2 you only change the constructor. Everything else in your sketch stays the same (this one compiles in 9,652 bytes):

#include <Wire.h>
#include <U8g2lib.h>
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
void setup() {
  u8g2.begin();
  u8g2.clearBuffer();
  u8g2.drawFrame(0, 0, 128, 64);
  u8g2.setFont(u8g2_font_6x10_tr);
  u8g2.drawStr(10, 36, "SH1106 OK");
  u8g2.sendBuffer();
}
void loop() {}

Use _1_ or _2_ instead of _F_ in the constructor name for page mode, which needs only 128 or 256 bytes of RAM for the screen.

Images: the same data works on both

Both chips show the same 1-bit picture data. A drawBitmap array made for an SSD1306 works unchanged on an SH1106 with Adafruit_SH1106G, and an XBM array works on both with U8g2. Only the display driver changes.

In OLED Bitmap Converter, choose 1.3" 128x64 SH1106 as the display. The generated sketch then uses Adafruit_SH1106G or the U8g2 SH1106 constructor, with the right begin() call. For the SSD1306, use the SSD1306 Bitmap Generator.

Which one should you buy?

Both are 128x64 monochrome screens and both work well with the right driver. The 1.3" SH1106 modules are bigger and easier to read from a distance. The SSD1306 has hardware scrolling, more memory modes and appears in more tutorials, so copied example code is more likely to work first time. If you buy a 1.3" module, plan to use Adafruit SH110X or U8g2 from the start.

Frequently Asked Questions

Is the SH1106 compatible with the SSD1306?

Not directly. They use the same pins, the same I2C address and the same image data, but the SH1106 has 132 columns of memory and only page addressing. SSD1306 code shows noise or a 2-pixel shift on an SH1106. Use the Adafruit_SH110X library or a U8g2 SH1106 constructor instead.

Why does my 1.3 inch OLED show random pixels with the Adafruit SSD1306 library?

Your module almost certainly has an SH1106 chip. The Adafruit_SSD1306 library uses a horizontal memory mode that the SH1106 does not have, so the picture lands in the wrong places. Install the Adafruit SH110X library and use Adafruit_SH1106G, or use U8g2 with U8G2_SH1106_128X64_NONAME_F_HW_I2C.

Why is my OLED picture shifted by 2 pixels?

You are running SSD1306 code on an SH1106 (picture shifted left, noise on the right edge) or SH1106 code on an SSD1306 (picture shifted right). The SH1106 has 132 columns of memory and the glass shows columns 2 to 129. Switch to the driver that matches your chip.

Do I need a different image or byte array for the SH1106?

No. Both chips show the same 1-bit image data. drawBitmap arrays for Adafruit and XBM arrays for U8g2 work on both; only the display driver in your sketch changes.

What I2C address do SH1106 and SSD1306 modules use?

Most modules of both types use 0x3C. Some use 0x3D, usually chosen by a small resistor on the back of the board. If the screen stays blank, run an I2C scanner sketch to see which address your module answers on.

Convert an image for your SH1106 or SSD1306

Pick your display and board, and get a complete sketch with the right driver. Still stuck? See the OLED troubleshooting guide.

Open OLED Bitmap Converter