Skip to content

Guide

Raspberry Pi Zero Pinout: Zero, Zero W and Zero 2 W GPIO Guide

Complete Raspberry Pi Zero pinout reference: a full pin-by-pin 40-pin GPIO table, physical vs BCM numbering, I2C/SPI/UART, and the Zero-specific port quirks (mini-HDMI, micro-USB OTG, camera cable).

  • 6 min read
  • Updated November 7, 2026
Raspberry Pi Zero Pinout: Zero, Zero W and Zero 2 W GPIO Guide

The Raspberry Pi Zero puts a full Linux computer on a board the size of a stick of gum, with the same 40-pin GPIO layout as every other modern Raspberry Pi. The same HATs, wiring diagrams and gpiozero code all work. What's different is everything around the header: it usually comes without pins soldered on, the ports are miniature, there's one LED instead of two, and the serial port works differently on the wireless models.

Quick answer: the Zero, Zero W and Zero 2 W share the standard 40-pin pinout: I2C on GPIO 2/3 (pins 3, 5), SPI0 on GPIO 7–11, UART on GPIO 14/15 (pins 8, 10), hardware PWM on GPIO 12, 13, 18, 19, with 5 V on pins 2 and 4, 3.3 V on pins 1 and 17, and 26 usable GPIOs, all 3.3 V only. Pin 1 is the square pad at the end nearest the microSD slot. Buy a WH or 2 WH version if you don't want to solder the header.

Below: the full pin table, power, the bus pins, the UART and Bluetooth catch, the ACT LED, the Zero's ports and USB gadget mode, and the mistakes that catch first-time Zero owners.

Raspberry Pi Zero 40-pin GPIO pinout with physical pin numbers, BCM GPIO numbers, power and ground

Zero, Zero W and Zero 2 W

Pi ZeroPi Zero WPi Zero 2 W
ProcessorBCM2835, 1 core, 1 GHzBCM2835, 1 core, 1 GHzRP3A0 (BCM2710A1), 4 cores, 1 GHz
RAM512 MB512 MB512 MB
Wi-Fi / BluetoothNo2.4 GHz Wi-Fi, Bluetooth 4.12.4 GHz Wi-Fi, Bluetooth 4.2 / BLE
64-bit OSNoNoYes
Header pre-solderedNoWH version2 WH version
40-pin GPIO layoutSameSameSame

The Zero 2 W is roughly five times faster on multi-threaded work and is the one to buy today; the original Zero and Zero W are only worth it if you already own them or need the lowest possible power draw.

The 40-Pin Header

PinFunctionPinFunction
13.3 V25 V
3GPIO2 (I2C1 SDA)45 V
5GPIO3 (I2C1 SCL)6GND
7GPIO4 (GPCLK0)8GPIO14 (UART TX)
9GND10GPIO15 (UART RX)
11GPIO1712GPIO18 (PWM0, PCM CLK)
13GPIO2714GND
15GPIO2216GPIO23
173.3 V18GPIO24
19GPIO10 (SPI0 MOSI)20GND
21GPIO9 (SPI0 MISO)22GPIO25
23GPIO11 (SPI0 SCLK)24GPIO8 (SPI0 CE0)
25GND26GPIO7 (SPI0 CE1)
27ID_SD (HAT EEPROM)28ID_SC (HAT EEPROM)
29GPIO530GND
31GPIO632GPIO12 (PWM0)
33GPIO13 (PWM1)34GND
35GPIO19 (PWM1, PCM FS)36GPIO16
37GPIO2638GPIO20 (PCM DIN)
39GND40GPIO21 (PCM DOUT)

Finding pin 1: it's at the end of the header nearest the microSD slot, on the inner row, and its pad on the underside is square while every other pad is round. Odd pins run along the inside row, even pins along the board edge.

Two numbering systems. Code uses BCM numbers (GPIO17); wiring diagrams often use physical positions (pin 11). They're different numbers for the same pin, and mixing them up is the most common Pi wiring mistake.

main.py
from gpiozero import LED
from time import sleep

led = LED(17)        # BCM 17 = physical pin 11
while True:
    led.toggle()
    sleep(0.5)

Pins 27 and 28 (GPIO0 and GPIO1) are reserved for the HAT identification EEPROM. Leave them alone unless you're designing a HAT.

Everything is 3.3 V and nothing is 5 V tolerant. A 5 V sensor output, an HC-SR04 echo line or an Arduino's TX needs a divider or level shifter. Each pin should be kept to a few milliamps (16 mA absolute maximum, and much less in total across all pins), so drive LEDs through a resistor and relays or motors through a transistor or driver board.

Power

Power the Zero through the micro-USB port labelled PWR IN, the one at the end of the board. Use a proper 5 V supply: the official one for the Zero 2 W is 5.1 V, 2.5 A. The original Zero and Zero W need less, but a weak phone charger or a long thin cable is still the most common cause of random reboots and corrupted SD cards, especially on the Zero 2 W under load.

PinUse
5 V (2, 4)Connected straight to the USB power input. Powers small 5 V loads, or can power the board from a regulated 5 V supply
3.3 V (1, 17)From the onboard regulator. For sensors and modules, not motors or LED strips
GND (8 pins)All connected together

Feeding 5 V into the header pins bypasses the protection on the USB input, so a reversed or over-voltage supply goes straight to the board. Do it only with a well-regulated supply and the polarity double-checked.

I2C, SPI, UART and PWM

Enable the buses with sudo raspi-config → Interface Options, or by adding lines to /boot/firmware/config.txt (on Raspberry Pi OS Bookworm and later; older releases used /boot/config.txt).

InterfaceBCM pinsPhysical pinsLinux device
I2C1SDA 2, SCL 33, 5/dev/i2c-1
SPI0MOSI 10, MISO 9, SCLK 11, CE0 8, CE1 719, 21, 23, 24, 26/dev/spidev0.0, /dev/spidev0.1
UARTTX 14, RX 158, 10/dev/serial0
Hardware PWM12, 13, 18, 1932, 33, 12, 35via dtoverlay=pwm-2chan

I2C has 1.8 kΩ pull-ups on the board already. After enabling it, i2cdetect -y 1 lists connected devices.

main.py
from gpiozero import PWMLED

led = PWMLED(18)
led.value = 0.5      # 50 % brightness (software PWM is fine for LEDs)

The UART and Bluetooth catch (Zero W and Zero 2 W)

The Pi has two UARTs: a full PL011 and a simpler mini UART. On the Zero W and Zero 2 W, the PL011 is connected to the Bluetooth chip, so GPIO 14/15 get the mini UART, whose baud rate drifts if the CPU clock changes. For a reliable serial link (GPS, an Arduino, a Modbus adapter) you have two options in /boot/firmware/config.txt:

  • dtoverlay=disable-bt gives the PL011 back to GPIO 14/15 and turns Bluetooth off. Also run sudo systemctl disable hciuart.
  • dtoverlay=miniuart-bt keeps Bluetooth working on the mini UART and gives the PL011 to the header.

Either way, use /dev/serial0 in your code; it always points at whichever UART is on GPIO 14/15. Turn off the serial login console in raspi-config if you want the port for your own device. The original Zero has no Bluetooth, so its PL011 is on the header already.

The ACT LED

Every Zero has a single green ACT LED and no red power LED, so a board that's powered but hasn't booted shows no light at all. The ACT LED flashes with SD card activity; when the Pi is fully shut down it stays off.

You can change what it shows in /boot/firmware/config.txt:

INI
dtparam=act_led_trigger=heartbeat     # double blink while Linux runs
# dtparam=act_led_trigger=none         # use it as a plain LED

Ports and USB Gadget Mode

PortWhat you need
Mini-HDMIA mini-HDMI to HDMI cable or adapter
Micro-USB USB (middle)An OTG adapter for a keyboard, hub or USB stick
Micro-USB PWR IN (end)Power only
Camera (CSI)The narrower 22-pin connector; needs a Zero camera cable, not the standard Pi cable
Test pads (underside)RUN (reset), and TV composite video on the W and 2 W

There's no Ethernet port on any Zero. The USB port has a special trick: it can make the Zero appear to your computer as a USB network adapter or serial port ("gadget mode"), so a single cable gives you power and an SSH connection with no Wi-Fi, keyboard or screen. It's the classic way to set up a Zero on the go, and Raspberry Pi Imager can enable it on recent releases.

Headless setup: in Raspberry Pi Imager, open the settings before writing the card and set the hostname, a username and password, your Wi-Fi network (2.4 GHz only) and SSH. The Zero then joins Wi-Fi on first boot and you can ssh [email protected].

Common Mistakes

MistakeFix
Wires pushed into the empty header holesSolder a 2×20 header, or buy the WH / 2 WH version
Keyboard plugged into PWR INUse the middle port marked USB, through an OTG adapter
No light at power-on, assumed deadThere's no power LED; check the green ACT LED flickers during boot
Standard camera cable doesn't fitThe Zero needs the narrower Zero camera cable
Serial data garbled on a Zero W / 2 WMini UART on GPIO 14/15; use dtoverlay=disable-bt or miniuart-bt
Edits to /boot/config.txt do nothingOn Bookworm the file is /boot/firmware/config.txt
Wi-Fi network not foundZeros are 2.4 GHz only; use the 2.4 GHz network
Random reboots, SD card corruptionUse a 5 V / 2.5 A supply and a short cable
GPIO damaged by a 5 V moduleEvery pin is 3.3 V only; use a level shifter

What the Zero Is Good For

A great fit: small always-on jobs where Linux helps, such as a Pi-hole, an MQTT broker or a small Node-RED instance on a Zero 2 W, a USB gadget, a Wi-Fi camera with the camera module, a sensor logger, or a retro game console. It uses well under a watt at idle on the original Zero.

A weaker fit: anything that needs precise timing (use a microcontroller such as a Pico or ESP32), heavy desktop use, or several USB devices at once.

FAQ

Is the Pi Zero pinout the same as the Pi 4 and Pi 5? Yes. The 40-pin header layout and pin functions are identical, so HATs and wiring diagrams carry over.

Does the Pi Zero have header pins? Not usually. The Zero, Zero W and Zero 2 W ship without them; the WH and 2 WH versions have them pre-soldered.

How many GPIO pins does the Pi Zero have? 26 usable GPIOs on the 40-pin header (BCM 2–27), plus power, ground and the two HAT EEPROM pins.

Are the GPIO pins 5 V tolerant? No. 3.3 V only.

Why is there no power LED? The Zero only has the green ACT LED, which shows SD card activity.

Which is the best Pi Zero to buy? The Zero 2 W, or the 2 WH if you don't want to solder.

Does RPi.GPIO work on the Zero? Yes, unlike on the Pi 5, but gpiozero is the recommended library on all Pi models.


Related guides: Raspberry Pi GPIO pinout reference (all 40-pin models) · Raspberry Pi 5 pinout · Install Mosquitto MQTT · Raspberry Pi Pico 2 pinout for a microcontroller alternative

Continue learning

Related articles

All articles

Signal In

Built from what makers search for

The lookups piling up in SolderHub's search bar every day shape what we publish next — new component pages, board guides, and firmware notes, sent out as they go live.

By subscribing you agree to our Privacy Policy. Unsubscribe anytime.