Electronics Design AU
Digital

How Do You Shift Logic Levels Between 3.3V and 5V, and When Do You Need a Level Shifter?

Last updated 7 July 2026 · 7 min read

Direct Answer

A level shifter is needed whenever two digital devices operate at different logic supply voltages and either device's input or absolute-maximum voltage rating would be violated by a direct connection — most commonly 3.3 V and 5 V logic in mixed designs. The right circuit depends on direction and signalling: a simple resistor voltage divider safely steps a 5 V output down to 3.3 V for a single unidirectional input; a 3.3 V push-pull output driving a 5 V CMOS input often works directly without any shifting at all, because most 5 V CMOS inputs accept a 3.3 V high as a valid logic 1 — but this must be verified against the specific part's V_IH, not assumed; and any open-drain, bidirectional bus (I2C being the standard example) requires a true bidirectional level shifter, either a discrete dual-MOSFET circuit or a dedicated bidirectional level-shifter/bus-buffer IC, because a simple divider or unidirectional translator cannot handle a signal that either side may pull low.

Detailed Explanation

Combining 3.3 V and 5 V logic in the same product is common — a 3.3 V microcontroller paired with a legacy 5 V sensor, an industrial peripheral, or an older reference design — and it is one of the most frequently referenced but rarely explained problems on this site: how do GPIO pins work?, how to interface Raspberry Pi GPIO, and what is CAN bus? each flag the need for a level shifter without covering the circuit choices in depth. This page covers those choices directly: when a direct connection is actually safe, and which shifting technique applies to which signal type.

Why Voltage Domains Don't Mix Safely by Default

Two things can go wrong when connecting devices at different logic voltages directly:

  • Exceeding an absolute maximum rating. Every digital input has a maximum voltage it can tolerate, usually specified relative to its own supply (commonly VDD + 0.3 V). Driving a 5 V signal into a 3.3 V-only input exceeds this rating and can permanently damage the input — this is the higher-risk direction and the one that most often needs active protection, not just a nominal logic-level mismatch.
  • Failing to reach a valid logic threshold. A signal can be within a device's absolute maximum rating but still not read reliably if it doesn't cross the receiving device's input threshold (V_IH for a valid high, V_IL for a valid low) — this is a logic-reliability problem rather than a damage risk, but it produces the same practical symptom: intermittent or garbled communication.

The FAQ above covers why the 3.3 V-driving-5 V direction is often (but not always) safe without any shifting at all, while the reverse direction almost always needs one.

Unidirectional Shifting: Resistor Divider

For a single signal travelling in one direction only — a 5 V sensor output feeding a 3.3 V ADC or GPIO input, for example — a simple resistor voltage divider is often sufficient:

5V signal ──── R1 ────┬──── to 3.3V input
                      │
                      R2
                      │
                     GND

With R1 = 1 kΩ and R2 = 2 kΩ, the divider output is 5 V × R2/(R1+R2) = 3.33 V. This works well for slow or static signals (a digital output changing at a few kHz or slower) but has two real limitations: it wastes some current continuously through the resistor chain, and the resistor values interact with the receiving pin's input capacitance to form an RC low-pass filter, which can round off edges enough to cause timing problems on faster signals (typical SPI clock rates and above). For those cases, a dedicated unidirectional or bidirectional translator IC is the better choice.

Unidirectional and Bidirectional Translator ICs

Dedicated level-shifter ICs fall into two functionally different categories, and picking the wrong one for a given bus type causes real reliability problems:

  • Push-pull, auto-direction-sensing translators (Texas Instruments TXB0108-class parts) actively drive both the high and low state on both sides, automatically sensing which side is driving at any moment. These work well for point-to-point signals and buses where both ends use conventional push-pull drivers — SPI, most GPIO lines, UART — but are unsuitable for a genuinely open-drain, wired-AND bus.
  • Open-drain-aware bidirectional buffers (PCA9306, TCA9516-class parts, and discrete dual-MOSFET circuits using parts like the BSS138) preserve open-drain, either-side pull-low behaviour across the voltage boundary — the requirement for I2C, covered in detail in the FAQ above.

Selecting by Signal Type

Signal / bus typeTypical solution
Single unidirectional digital input, moderate speedResistor divider
Single unidirectional digital input, higher speedUnidirectional or push-pull translator IC
SPI (point-to-point, push-pull, all lines unidirectional per line)Push-pull translator IC (e.g. SN74LVC8T245-class)
I2C (open-drain, bidirectional, both sides may pull low)Open-drain-aware bidirectional buffer (PCA9306/TCA9516) or discrete MOSFET shifter
UART (point-to-point, push-pull)Push-pull translator IC, or often no shifting needed if only 3.3 V-to-5 V (see FAQ)
CAN busMatch the transceiver's supply voltage to the controller's logic voltage directly where possible (see what is CAN bus?) rather than level-shifting the differential bus lines themselves

Zeus Design designs the mixed-voltage interfacing — level shifter selection, bus buffering, and the surrounding PCB layout — as part of complete product electronics development.

Design Considerations

  • Verify V_IH and absolute maximum ratings explicitly, on both devices, before deciding shifting is unnecessary. As covered in the FAQ above, a 3.3-into-5V connection is frequently safe but must be confirmed against the specific parts' datasheets, not assumed from general logic-family behaviour.
  • Match the shifter topology to the bus's electrical behaviour, not just its name. The most common real-world mistake is applying a push-pull translator IC (TXB0108-class) to an open-drain bus like I2C — see the FAQ above for why this fails in practice despite both being called "level shifters."
  • Account for RC rolloff on resistor-divider solutions at higher signal speeds. A divider sized correctly for DC accuracy can still round off edges enough to cause timing failures on faster signals — check against the receiving pin's input capacitance and the signal's required edge rate, and move to an active translator IC where the divider's RC time constant becomes significant relative to the signal period.
  • Budget the extra board space and, for I2C, the extra bus capacitance. A level shifter — especially a dedicated IC — adds a component and, on I2C, adds capacitance to both sides of the bus, which interacts with the bus's overall length and pull-up sizing; verify the combined bus capacitance against the I2C specification's maximum (400 pF for standard/fast mode) after adding a shifter.

Common Mistakes

  • Using a push-pull translator (TXB0108-class) on I2C or another open-drain bus. Covered in detail in the FAQ above — this produces unreliable bus behaviour because the translator actively drives both directions rather than preserving open-drain pull-low behaviour.
  • Assuming a resistor divider works for any signal speed. A divider sized for DC accuracy alone can silently degrade timing on faster digital signals due to RC rolloff — verify against the actual signal speed, not just the target voltage.
  • Connecting a 5V output directly to a 3.3V-only input "because it worked on the bench." A brief bench test at room temperature can appear to work even when a device is being driven outside its absolute maximum rating — cumulative damage or temperature-dependent failure can still occur, and the practice remains a genuine reliability risk regardless of short-term bench behaviour.
  • Forgetting that a level shifter changes bus capacitance and timing on I2C. Especially at higher I2C clock rates, the added capacitance from a bidirectional buffer IC can push a bus over its specified capacitance limit if not accounted for during pull-up resistor sizing.
  • Assuming every 5V-rated peripheral is 5V-tolerant on its inputs. "5 V supply" and "5 V-tolerant input" are not the same claim — some parts run from a 5 V supply but specify a lower maximum input voltage on certain pins; always check the specific pin's rating, not just the part's overall supply voltage.

Frequently Asked Questions

Can I connect a 3.3V output directly to a 5V input without any level shifting?
Often yes, but it must be verified rather than assumed. Most 5 V CMOS logic families recognise an input as high once it exceeds roughly 70% of their supply voltage (a common LVCMOS/HCT-family threshold), which a 3.3 V push-pull output typically satisfies — so a 3.3 V output driving a 5 V input is frequently safe with no shifting at all. This does not work in the other direction: a 5 V output driving a 3.3 V input is unsafe without shifting, because the 5 V signal exceeds the 3.3 V device's absolute maximum input voltage rating (commonly VDD + 0.3 V, so around 3.6 V) and can permanently damage the input. Always check the specific input device's V_IH (minimum recognised high) for the 3.3-into-5V direction, and the absolute maximum input voltage rating for the 5-into-3.3V direction, rather than assuming either direction is automatically safe.
Why can't I use a simple resistor divider or a unidirectional buffer chip for I2C level shifting?
I2C is an open-drain, bidirectional bus: both the master and any slave device can pull SDA (and SCL, during clock stretching) low, and the bus relies on pull-up resistors alone to return it high — no device on the bus ever actively drives it high. A resistor divider only translates a signal traveling in one direction (from the higher-voltage side down to the lower-voltage side) and does nothing for the reverse direction, so it cannot handle a bus where either side needs to pull low. A simple unidirectional buffer IC has the same problem — it has a defined input and output side and cannot let a signal originating on its output side pull the input side low. I2C specifically needs a true bidirectional level shifter: a discrete dual-N-channel-MOSFET circuit (with a pull-up resistor to each supply rail) or a dedicated bidirectional I2C-buffer IC such as the PCA9306 or TCA9516, both of which preserve open-drain, either-direction pull-low behaviour across the voltage boundary.
What's the difference between a MOSFET-based level shifter and a dedicated IC like the TXB0108?
A discrete BSS138-style dual-MOSFET level shifter is a low-cost, simple bidirectional shifter widely used for open-drain buses like I2C — cheap, easy to hand-solder, and adequate for moderate bus speeds, but it has a finite switching speed set by the pull-up resistor values and bus capacitance, which limits it at higher I2C clock rates or long bus traces. A dedicated bidirectional translator IC such as the TXB0108 uses active circuitry per channel to translate faster and with better defined timing, at higher cost and in a smaller, harder-to-hand-solder package. Critically, the TXB0108 is a push-pull auto-direction-sensing translator, not an open-drain-compatible device — using it on I2C's open-drain bus produces unreliable behaviour, since it actively drives both directions rather than preserving the wired-AND pull-low behaviour I2C depends on. Use a push-pull-style translator (TXB0108-class) for point-to-point unidirectional or genuinely bidirectional-but-not-open-drain signals (SPI, most GPIO), and an open-drain-aware bidirectional buffer (PCA9306/TCA9516-class, or a discrete MOSFET shifter) specifically for I2C and other open-drain buses.

References

Related Questions

Related Forum Discussions