All pinouts

Raspberry Pi

Raspberry Pi 5 GPIO Pinout

The 40-pin GPIO header on the Raspberry Pi 5 is pin-compatible with every modern Pi (4, 3, Zero 2 W). The Pi 5 swaps the BCM2711 for the BCM2712 and moves GPIO control to the new RP1 I/O chip, so a few low-level libraries that touched /dev/mem are broken on Pi 5 — use lgpio or gpiod instead of RPi.GPIO.

Specifications

SoC
Broadcom BCM2712 (4× Cortex-A76 @ 2.4 GHz)
I/O controller
RP1 (south bridge)
GPIO logic level
3.3V — NOT 5V tolerant
Total pins on header
40
Programmable GPIOs
28 (GPIO 0–27)
Hardware PWM
4 channels (GPIO 12, 13, 18, 19)

Pin reference

PinNameType / functionsNotes
13V3Power, ~500 mA—
25VPower, from PSU—
3GPIO2 / SDA1I2C SDA—
45VPower—
5GPIO3 / SCL1I2C SCL—
6GNDGround—
7GPIO4 / GPCLK0Digital I/O—
8GPIO14 / TXDUART TX—
9GNDGround—
10GPIO15 / RXDUART RX—
11GPIO17Digital I/O—
12GPIO18 / PWM0Hardware PWM—
13GPIO27Digital I/O—
14GNDGround—
15GPIO22Digital I/O—
16GPIO23Digital I/O—
173V3Power—
18GPIO24Digital I/O—
19GPIO10 / MOSISPI0 MOSI—
20GNDGround—
21GPIO9 / MISOSPI0 MISO—
22GPIO25Digital I/O—
23GPIO11 / SCLKSPI0 SCLK—
24GPIO8 / CE0SPI0 CE0—
25GNDGround—
26GPIO7 / CE1SPI0 CE1—
27ID_SD (GPIO0)Reserved for HAT EEPROM—
28ID_SC (GPIO1)Reserved for HAT EEPROM—
29GPIO5Digital I/O—
30GNDGround—
31GPIO6Digital I/O—
32GPIO12 / PWM0Hardware PWM—
33GPIO13 / PWM1Hardware PWM—
34GNDGround—
35GPIO19 / PWM1Hardware PWM, I2S FS—
36GPIO16Digital I/O—
37GPIO26Digital I/O—
38GPIO20 / I2S DINDigital I/O—
39GNDGround—
40GPIO21 / I2S DOUTDigital I/O—

Gotchas

  • 01GPIOs are 3.3V logic and NOT 5V tolerant — feeding 5V into a GPIO will damage the SoC. Use a level shifter for 5V sensors.
  • 02On Pi 5, RPi.GPIO and pigpio do not work. Use lgpio, gpiozero (recent), or the libgpiod CLI (gpioset/gpioget).
  • 03Pins 27/28 (GPIO 0/1) are reserved for HAT EEPROM detection — avoid for general use.
  • 04Each GPIO can source/sink ~16 mA safely, with a hard total budget of 50 mA across the whole header.

Explain code for this board

Paste a sketch and get a plain-English breakdown.

Open code explainer

Generate a wiring diagram

Describe your circuit and get a Mermaid diagram you can share.

Open diagram generator

Other boards