The Raspberry Pi 5 retains the physical 40-pin GPIO header layout of its predecessors, but the underlying architecture has fundamentally shifted. The BCM2712 SoC no longer handles GPIO directly; instead, the dedicated RP1 southbridge chip manages all peripheral I/O. This means while the physical raspberry pi 5 pinout is backward-compatible, the electrical characteristics and silkscreen markings require a fresh look. Below is the definitive reference, updated for the RP1 architecture.
The Complete Raspberry Pi 5 Pinout Table
Unlike older models where the BCM chip handled everything, the Pi 5 routes these pins through the RP1. The physical pin numbers (1-40) remain identical for HAT compatibility. Orient the board with the USB-C power connector facing left and the USB-A ports facing you; the GPIO header will be on the top right.
| Phys | BCM/GPIO | Function | Name | Phys | BCM/GPIO | Function | Name |
|---|---|---|---|---|---|---|---|
| 1 | - | Power | 3.3V | 2 | - | Power | 5V |
| 3 | 2 | I2C SDA | GPIO 2 | 4 | - | Power | 5V |
| 5 | 3 | I2C SCL | GPIO 3 | 6 | - | Ground | GND |
| 7 | 4 | GPCLK0 | GPIO 4 | 8 | 14 | UART TX | GPIO 14 |
| 9 | - | Ground | GND | 10 | 15 | UART RX | GPIO 15 |
| 11 | 17 | General | GPIO 17 | 12 | 18 | PCM CLK | GPIO 18 |
| 13 | 27 | General | GPIO 27 | 14 | - | Ground | GND |
| 15 | 22 | General | GPIO 22 | 16 | 23 | General | GPIO 23 |
| 17 | - | Power | 3.3V | 18 | 24 | General | GPIO 24 |
| 19 | 10 | SPI MOSI | GPIO 10 | 20 | - | Ground | GND |
| 21 | 9 | SPI MISO | GPIO 9 | 22 | 25 | General | GPIO 25 |
| 23 | 11 | SPI SCLK | GPIO 11 | 24 | 8 | SPI CE0 | GPIO 8 |
| 25 | - | Ground | GND | 26 | 7 | SPI CE1 | GPIO 7 |
| 27 | 0 | EEPROM | ID_SD | 28 | 1 | EEPROM | ID_SC |
| 29 | 5 | General | GPIO 5 | 30 | - | Ground | GND |
| 31 | 6 | General | GPIO 6 | 32 | 12 | PWM0 | GPIO 12 |
| 33 | 13 | PWM1 | GPIO 13 | 34 | - | Ground | GND |
| 35 | 19 | SPI MISO | GPIO 19 | 36 | 16 | SPI CE2 | GPIO 16 |
| 37 | 26 | General | GPIO 26 | 38 | 20 | SPI MOSI | GPIO 20 |
| 39 | - | Ground | GND | 40 | 21 | SPI SCLK | GPIO 21 |
Note: The Pi 5 also introduces new non-GPIO headers: a 4-pin JST fan connector, a 3-pin RTC battery connector, and a 16-pin PCIe 2.0 FPC connector. These are separate from the 40-pin layout detailed above. For official schematics, refer to the Raspberry Pi Documentation.
Wire Color Standards & Regional Variants
The Raspberry Pi 5 pinout itself is universal, but the wires you use to connect sensors and relays are not. Using the wrong color convention on a custom harness can lead to catastrophic shorts. Here is how different standards apply to Pi wiring:
| Standard / Region | 5V / VCC | 3.3V / Logic | Ground / Earth | Signal / Data |
|---|---|---|---|---|
| US Electronics (Hobbyist) Adafruit/SparkFun Dupont | Red | Orange | Black | Yellow / Blue |
| IEC 60446 (EU Industrial) Mains & Control Panels | Brown (Line) | N/A (Use Orange) | Green/Yellow (PE) | Blue (Neutral) / Black |
| Old UK (Pre-2004) Legacy Mains | Red (Line) | N/A | Green (Earth) | Yellow / Blue |
| ATX / PC Standard Power Supplies | Red (+5V) | Orange (+3.3V) | Black (COM) | Yellow (+12V) |
Safe interpretation when markings are faded or missing: If you inherit a Pi with worn silkscreen or a 3D-printed case blocking the pin labels, never guess. Locate Pin 1 by finding the square solder pad on the underside of the board (all other pads are round). Alternatively, orient the board so the USB-C power port is on the left; Pin 1 is the top-left pin of the header. Always verify with a multimeter set to DC voltage before connecting sensitive I2C or SPI sensors.
Rows People Get Wrong (And How to Avoid Bricking Your Pi)
The RP1 chip on the Pi 5 is robust, but it is not invincible. These are the most common pinout mistakes that result in dead boards or erratic sensor readings:
- The 3.3V vs 5V Trap (Pins 1/17 vs Pins 2/4): The 3.3V rail on the Pi 5 is generated by an onboard switching regulator. If you accidentally wire a 5V sensor output into a 3.3V GPIO, or short Pin 2 (5V) to Pin 1 (3.3V), you will instantly overvoltage the RP1 logic core. Fix: Use a logic level shifter (like the TXS0108E) for any 5V Arduino-style sensors.
- I2C Pull-Up Confusion (Pins 3 & 5): GPIO 2 (SDA) and GPIO 3 (SCL) have physical 1.8kΩ pull-up resistors hardwired to the 3.3V rail on the Pi 5 PCB. If you connect a 5V I2C device that also has pull-ups to 5V, you will back-feed 5V into the Pi's 3.3V rail through those resistors. Fix: Check your sensor module; if it has pull-ups, disable them or use an I2C isolator.
- UART Boot Spam (Pins 8 & 10): GPIO 14 (TX) and GPIO 15 (RX) are tied to the primary UART console by default. If you wire a relay or motor driver to these pins, it will trigger erratically the moment the Pi boots, as the bootloader sends console text to the TX pin. Fix: Disable the serial console in
raspi-configor move to alternate UART pins. - SPI Chip Select Collisions (Pins 24 & 26): GPIO 8 (CE0) and GPIO 7 (CE1) are hardware chip selects. If you wire two SPI devices but forget to manage the CE lines in your Python/C code, both devices will talk on the MISO line simultaneously, causing bus contention and corrupted data.
Frequently Asked Questions
Does the Raspberry Pi 5 pinout match the Pi 4?
Physically, yes. The 40-pin header layout, pin numbers, and primary functions (I2C on 3/5, SPI on 19/21/23/24) are identical, ensuring backward compatibility with existing HATs. However, electrically, the Pi 5 routes these through the RP1 southbridge rather than the main BCM SoC. This means device tree overlays and low-level bare-metal C code written for the Pi 4's BCM2711 memory addresses will not work on the Pi 5 without being recompiled for the RP1's address space.
Are Raspberry Pi 5 GPIO pins 5V tolerant?
No. Every GPIO pin on the Raspberry Pi 5 operates at strictly 3.3V logic levels. The RP1 chip does not feature 5V-tolerant inputs. Feeding a 5V signal into any GPIO pin (including the I2C and SPI lines) will exceed the absolute maximum ratings and likely destroy the pin's internal ESD protection diodes, permanently damaging the RP1 chip. Always use a bidirectional logic level shifter for 5V peripherals.
How do I find Pin 1 if the silkscreen is faded or missing?
If the white silkscreen text on the PCB is worn away, look at the solder pads on the underside of the board. Pin 1 is the only pad with a square shape; all other 39 pins have circular pads. If the board is mounted in a case and you cannot see the bottom, orient the Pi so the USB-C power connector is on the left and the USB-A ports are facing you. Pin 1 will be the top-left pin of the 2x20 header. Verify with a multimeter (reading ~3.3V DC between Pin 1 and Pin 6) before connecting sensitive hardware.
What is the maximum current draw per GPIO pin on the Pi 5?
The RP1 chip defaults to an 8mA drive strength per GPIO pin, which can be safely configured up to 16mA via software registers. However, you must also respect the total bank current limits. The combined current draw across all GPIO pins should not exceed 50mA to prevent voltage droop on the 3.3V rail. For driving LEDs, relays, or motors, never source power directly from the GPIO pins; use a MOSFET (like the 2N7000 for small loads) or an optocoupler to switch external 5V or 12V power. For deeper hardware limits, consult the RP1 Peripherals Datasheet.






