The Raspberry Pi Zero 2 W pinout is identical to the standard 40-pin header found on the Pi 3, 4, and 5. Pin 1 (3.3V) is located at the top-left corner of the header, closest to the microSD card slot. The board operates on a 3.3V logic level; injecting 5V into any GPIO pin will permanently destroy the BCM2710A1 SoC. Below is the complete physical and functional reference.

The Complete 40-Pin GPIO Header Reference

This table maps the physical pin numbers to their BCM GPIO designations and primary alternate functions. When designing custom HATs or wiring harnesses, use the 'Standard Harness Color' column as a baseline, adjusting for your regional code requirements (detailed in the wire standards section below).

PinLeft Row (Odd)Right Row (Even)Pin
13V3 Power (Red/Orange)5V Power (Red/Brown)2
3GPIO 2 (SDA1 / I2C)5V Power (Red/Brown)4
5GPIO 3 (SCL1 / I2C)Ground (Black/Blue)6
7GPIO 4 (GPCLK0)GPIO 14 (TXD / UART)8
9Ground (Black/Blue)GPIO 15 (RXD / UART)10
11GPIO 17 (SPI1 CE1)GPIO 18 (PCM_CLK / SPI1 CE0)12
13GPIO 27Ground (Black/Blue)14
15GPIO 22GPIO 23 (SPI0 SCLK)16
173V3 Power (Red/Orange)GPIO 24 (SPI0 MOSI)18
19GPIO 10 (SPI0 MOSI)Ground (Black/Blue)20
21GPIO 9 (SPI0 MISO)GPIO 2522
23GPIO 11 (SPI0 SCLK)GPIO 8 (SPI0 CE0)24
25Ground (Black/Blue)GPIO 7 (SPI0 CE1)26
27ID_SD (I2C HAT EEPROM)ID_SC (I2C HAT EEPROM)28
29GPIO 5Ground (Black/Blue)30
31GPIO 6GPIO 1232
33GPIO 13Ground (Black/Blue)34
35GPIO 19 (SPI1 MISO)GPIO 16 (SPI1 CE2)36
37GPIO 26GPIO 20 (SPI1 MOSI)38
39Ground (Black/Blue)GPIO 21 (SPI1 SCLK)40

Source: Pinout.xyz and Raspberry Pi Official Documentation.

Rows People Get Wrong (And How to Avoid Bricking Your Pi)

When wiring sensors or actuators to the Zero 2 W, three specific pin groups cause 90% of hardware failures and software debugging headaches.

WARNING: 5V Tolerance
The BCM2710A1 SoC on the Zero 2 W is strictly 3.3V. Connecting a 5V sensor output directly to any GPIO pin (including the I2C SDA/SCL lines) will fry the internal ESD protection diodes and permanently kill the pin or the entire chip. Always use a bidirectional logic level converter (like the Texas Instruments TXS0108E) when interfacing 5V Arduino-style modules.

The ID_SD and ID_SC Trap (Pins 27 & 28)

Beginners often see 'I2C' next to Pins 27 and 28 and attempt to wire standard sensors to them. Do not do this. These pins are connected to a dedicated I2C bus reserved exclusively for reading the EEPROM on official Raspberry Pi HATs. Using them for general-purpose I2C can cause boot-time conflicts, bus lockups, and prevent HAT auto-configuration. Stick to Pins 3 and 5 for your BME280 or OLED displays.

The UART / Bluetooth Conflict (Pins 8 & 10)

Pins 8 (TXD) and 10 (RXD) map to GPIO 14 and 15. Out of the box on Raspberry Pi OS (Bookworm and newer), the primary hardware UART (/dev/ttyAMA0) is routed to the onboard Bluetooth module, leaving the GPIO header with the slower 'mini-UART' (/dev/ttyS0), which lacks a stable baud rate clock. If you are connecting a GPS module or a 3D printer controller board that requires precise hardware UART timing, you must free up the primary UART by adding dtoverlay=disable-bt to your /boot/firmware/config.txt file and rebooting.

SPI0 vs SPI1 Bus Confusion

The Zero 2 W exposes two SPI buses. SPI0 (Pins 19, 21, 23, 24, 26) is the primary high-speed bus. SPI1 (Pins 35, 38, 40, 12, 36, 11) is a secondary auxiliary bus. If you are wiring an SPI TFT display or an ADC like the MCP3008, always default to SPI0. SPI1 requires specific device tree overlays (dtoverlay=spi1-1cs) to function correctly and shares pins with the I2S PCM audio interface.

Wire Color Standards for Custom Pi Harnesses

When embedding a Pi Zero 2 W into an industrial enclosure, 3D-printed kiosk, or custom PCB, you will likely build a custom wiring harness rather than using a standard rainbow ribbon cable. The color codes for low-voltage DC control wiring differ significantly by region. Adhering to these standards ensures your build passes safety inspections and is maintainable by other technicians.

FunctionUS Standard (NFPA 79 / NEC)EU / UK Standard (IEC EN 60204-1)Old UK (Pre-2004)
DC Positive (+5V)RedBrownRed
DC Positive (+3.3V)Orange or Red w/ White TracerOrange or Brown w/ White TracerOrange
DC Negative / Return (GND)Black or BlueBlueBlack
Protective Earth (Chassis)Green w/ Yellow StripeGreen w/ Yellow StripeGreen
Signal / Data LinesWhite, Yellow, or BlackBlack or GreyWhite or Grey
Interlock / Safety StopYellowYellowYellow

Reference: NFPA 79 Electrical Standard for Industrial Machinery and IEC 60204-1.

Practical Application: If you are wiring a 5V relay module to Pin 2 (5V) and Pin 6 (GND) in a US-based project, use Red for the 5V feed and Black for the ground return. If that same project is being shipped to a German facility, you must swap to Brown (5V) and Blue (GND) to comply with CE marking requirements for machinery control circuits. Signal wires (like the GPIO trigger to the relay IN pin) should be Black in the EU and White or Yellow in the US.

Safe Interpretation When Markings Are Faded or Missing

The silkscreen on the Pi Zero 2 W is notoriously small, and if you are working with a cloned board, a refurbished unit, or a board where the flux residue has obscured the text, guessing Pin 1 is a fast track to injecting 5V into the 3.3V rail. Here is the bench-tested procedure to identify your pins blindly.

  1. Locate the Ground Reference: Set your multimeter to continuity mode (the diode/beep setting). Place one probe on the metal shielding of the mini-HDMI or USB OTG port. Probe the header pins with the other lead. Pins 6, 9, 14, 20, 25, 30, 34, and 39 will beep. You have now mapped your ground pins.
  2. Identify the Row Orientation: The ground pins are distributed across both rows, but Pin 1 is always on the inner row (the row closest to the BCM SoC and the SD card). If you are looking down at the board with the GPIO header on the right side, the left row is the inner row.
  3. Verify the 3.3V Rail: Power the board via the USB PWR port. Switch your multimeter to DC Voltage. Place the black probe on a confirmed Ground pin. Probe the top-left pin of the inner row (suspected Pin 1). It must read between 3.28V and 3.32V. If it reads ~5.1V, you are probing the outer row (Pin 2). If it reads 0V, the board's 3.3V voltage regulator (U3) has failed, or you are probing a standard GPIO pin that is currently pulled low.

By combining continuity testing against the port shields with a live voltage verification, you can safely map the entire Raspberry Pi Zero 2 W pinout without relying on faded silkscreen or ambiguous documentation.