GPIO Pinout Reference

Read this before wiring anything: every GPIO pin on the Raspberry Pi Zero W operates at 3.3V logic and is NOT 5V tolerant. Connecting 5V directly to a GPIO signal pin (as opposed to the dedicated 5V power pins, which are perfectly fine) can permanently damage the board. Always double-check which pin you're using before powering anything on.

The Zero W uses the same 40-pin GPIO header layout found across the whole modern Raspberry Pi lineup - the Zero, Zero W, Zero 2 W, and the Pi 2/3/4/5 boards all share this exact same physical pinout, so a diagram or HAT built for one generally works on any of them. On the standard Zero W SKU, this header ships unpopulated (no pins pre-soldered) - you'll need to solder your own header, use a Zero WH variant that comes with one pre-soldered, or use press-fit pogo-pin connectors, depending on your project.

The Complete 40-Pin Layout

PinFunctionPinFunction
13V3 Power25V Power
3GPIO2 (SDA)45V Power
5GPIO3 (SCL)6Ground
7GPIO4 (GPCLK0)8GPIO14 (TXD)
9Ground10GPIO15 (RXD)
11GPIO1712GPIO18 (PCM_CLK)
13GPIO2714Ground
15GPIO2216GPIO23
173V3 Power18GPIO24
19GPIO10 (MOSI)20Ground
21GPIO9 (MISO)22GPIO25
23GPIO11 (SCLK)24GPIO8 (CE0)
25Ground26GPIO7 (CE1)
27GPIO0 (ID_SD)28GPIO1 (ID_SC)
29GPIO530Ground
31GPIO632GPIO12 (PWM0)
33GPIO13 (PWM1)34Ground
35GPIO19 (PCM_FS)36GPIO16
37GPIO2638GPIO20 (PCM_DIN)
39Ground40GPIO21 (PCM_DOUT)

28 usable GPIO signal pins in total, plus power (two 3V3 pins, two 5V pins) and ground pins.

Physical Pin Number vs BCM/GPIO Number

This is one of the most common beginner mix-ups, so it's worth being explicit about it. There are two different numbering systems in play at the same time:

  • Physical pin numbering (1-40) - a simple left-to-right, top-to-bottom count of the physical pins on the header, used when you're wiring things up by hand or following a diagram.
  • BCM / GPIO numbering - the number the Broadcom chip (and your code) actually refers to that pin by, e.g. "GPIO17". This is what you'll use in Python code with libraries like gpiozero.

These two numbers are not the same, and mixing them up is a very common mistake. For example: physical pin 11 corresponds to GPIO17 in code - but physical pin 17 is a 3.3V power pin, not a GPIO at all. Always double check which numbering scheme a diagram or tutorial is using before you wire anything or write code against a pin number.

This page's code and terminal commands are a preview, not something you can run right on this website - this server runs PHP, not the Zero W's own operating system.

What the Shared-Function Pins Mean

ProtocolPinsUsed for
I2CPin 3 (SDA), Pin 5 (SCL)A simple two-wire bus for talking to sensors and small peripheral chips that support I2C
SPIPins 19 (MOSI), 21 (MISO), 23 (SCLK), 24 (CE0), 26 (CE1)A faster bus commonly used for displays, SD cards, and certain sensors
UART / SerialPin 8 (TXD), Pin 10 (RXD)Simple serial communication - handy for a console connection or talking to another microcontroller
PWMPin 32 (PWM0), Pin 33 (PWM1)Pulse-width modulation - useful for dimming LEDs smoothly or controlling motor/servo speed
Pins 27 and 28 (ID_SD / ID_SC) are reserved for HAT (add-on board) identification EEPROMs - the Pi uses them to automatically detect and configure certain add-on boards. As a beginner, avoid using these two pins as regular GPIO in your own projects.
Next steps: With the pinout memorized, move on to Getting Started: Flashing the OS to get Raspberry Pi OS onto a microSD card.