The Raspberry Pi 5 retains the standard 40-pin J8 header layout, but its I/O is now driven by the dedicated RP1 southbridge chip rather than the main BCM2712 SoC. Pin 1 is always the 3.3V power rail located closest to the microSD card slot and USB-C power input. If you are wiring sensors or HATs, the physical pin numbers remain identical to the Pi 4, but the underlying voltage tolerances, I2C pull-up behaviors, and PWM routing have shifted. Below is the exact hardware mapping you need before you connect a single jumper wire.

The Complete Pinout Raspberry Pi 5 40-Pin Reference Table

This table maps the physical J8 header pins to their BCM GPIO equivalents and primary functions. The Raspberry Pi 5 uses the BCM2712 naming convention for software compatibility, even though the RP1 chip physically routes the signals. Always wire by the Physical Pin number, not the GPIO number, to avoid catastrophic miswiring.

PhysBCMFunction / NameRailPhysBCMFunction / NameRail
1-3.3V Power3.3V2-5V Power5V
32GPIO2 (SDA1)3.3V4-5V Power5V
53GPIO3 (SCL1)3.3V6-GroundGND
74GPIO4 (GPCLK0)3.3V814GPIO14 (TXD0)3.3V
9-GroundGND1015GPIO15 (RXD0)3.3V
1117GPIO173.3V1218GPIO18 (PWM0)3.3V
1327GPIO273.3V14-GroundGND
1522GPIO223.3V1623GPIO233.3V
17-3.3V Power3.3V1824GPIO243.3V
1910GPIO10 (MOSI)3.3V20-GroundGND
219GPIO9 (MISO)3.3V2225GPIO253.3V
2311GPIO11 (SCLK)3.3V248GPIO8 (CE0)3.3V
25-GroundGND267GPIO7 (CE1)3.3V
270GPIO0 (ID_SD)3.3V281GPIO1 (ID_SC)3.3V
295GPIO53.3V30-GroundGND
316GPIO63.3V3212GPIO12 (PWM0)3.3V
3313GPIO13 (PWM1)3.3V34-GroundGND
3519GPIO19 (MISO)3.3V3616GPIO16 (CE2)3.3V
3726GPIO263.3V3820GPIO20 (MOSI)3.3V
39-GroundGND4021GPIO21 (SCLK)3.3V

Rows People Get Wrong: Fritzing Disasters & Fried Pins

When builders transition from older microcontrollers to the Pi 5, three specific pin groups cause the most hardware damage and debugging headaches. According to the official Raspberry Pi 5 datasheet, the RP1 southbridge operates strictly at 3.3V logic levels.

WARNING: No 5V Tolerance on Pi 5 GPIO
Unlike some 5V Arduinos or older industrial PLCs, the Raspberry Pi 5 GPIO pins are not 5V tolerant. The absolute maximum voltage on any GPIO pin is 3.6V. Feeding a 5V sensor output directly into Pin 8 (GPIO14) or any other data pin will permanently destroy the RP1 southbridge chip. Always use a logic level shifter (like the TXB0108 or BSS138 MOSFET circuit) when interfacing 5V hardware.

The ID EEPROM Trap (Pins 27 & 28): Physical pins 27 (GPIO0) and 28 (GPIO1) are mapped to the I2C0 bus, which is strictly reserved for reading the HAT (Hardware Attached on Top) identification EEPROM. If you wire a standard I2C sensor (like a BME280) to these pins, it will conflict with the boot sequence HAT detection. Always use Pins 3 and 5 (I2C1) for general-purpose I2C sensors.

The PWM Confusion (Pins 12, 32, and 33): On the Pi 4, hardware PWM was somewhat restricted. On the Pi 5, the RP1 chip features a completely redesigned PWM controller with up to 8 channels. However, the default Linux device tree maps PWM0 to GPIO12 (Pin 32) and PWM1 to GPIO13 (Pin 33). If you are following an older tutorial that tells you to use GPIO18 (Pin 12) for hardware PWM audio output, you will need to update your config.txt (now config.toml on Pi 5 Bookworm OS) to route the audio PWM correctly via the RP1 overlay.

HAT Standards, Ribbon Cables, and Wiring Color Codes

While the physical pinout of the Raspberry Pi is universal globally, the color codes used for jumper wires and ribbon cables depend on the standard you are following. The Raspberry Pi HAT Design Guide mandates specific electrical behaviors, but physical wiring colors vary by manufacturer.

Standard / BrandPower (VIN/VCC)Ground (GND)I2C SDAI2C SCLSPI MOSI
Generic Dupont JumpersRed (5V) / Orange (3.3V)BlackVariesVariesVaries
Adafruit / SparkFun I2CRedBlackBlueYellowN/A
Standard 40-Pin RibbonPin 1 (Red Stripe)Black wiresN/AN/AN/A
PC / ATX Panel HeadersRedBlackN/AN/AN/A

Ribbon Cable Orientation: If you are using a 40-pin IDC ribbon cable to break out the GPIO to a breadboard or a custom PCB, the red stripe on the cable always denotes Pin 1. Plugging the ribbon cable in backwards will route 5V directly into the 3.3V rail and ground pins into data lines, instantly killing the board. Always verify the red stripe aligns with Pin 1 (the corner closest to the USB-C power port) before applying power.

HAT Mechanical Standards: A compliant Pi HAT must include an ID EEPROM connected to pins 27 and 28, and it must use the four M2.5 mounting holes that align perfectly with the Pi 5 board. The Pi 5 introduced a slightly different thermal profile and a dedicated RTC battery connector, but the J8 header mechanical spacing remains exactly 2x20 pins at 0.1-inch (2.54mm) pitch, ensuring backward physical compatibility with Pi 4 HATs.

Safe Interpretation When Board Markings Fade or Vary

On heavily used workshop boards, or when the Pi 5 is mounted inside an opaque aluminum passive-cooling case, the tiny silkscreen 'P1' or '3V3' markings on the PCB become impossible to read. Guessing the pinout based on memory is how you short the 5V rail to the I2C clock line. Here is the definitive procedure to safely identify Pin 1 and verify your header when markings are missing.

Step 1: Use Physical Landmarks
Locate the USB-C power input port and the microSD card slot. The 40-pin J8 header is situated between these two components. Pin 1 is always the 3.3V pin located in the corner closest to the USB-C port and the SD card. Pin 2 (5V) is directly adjacent to it on the outer edge of the board.

Step 2: The Multimeter Verification Test
If the board is powered on and you need to verify the rails before connecting a sensitive sensor:

  1. Set your multimeter to DC Voltage (20V range).
  2. Place the black probe on the metal shielding of any of the USB-A ports (this is a guaranteed, safe chassis ground).
  3. Touch the red probe to the suspected Pin 1. You should read exactly 3.28V to 3.32V.
  4. Move the red probe one pin over (suspected Pin 2). You should read 4.95V to 5.15V.
Bench Tip: Never use the 'continuity beep' mode on your multimeter while the Raspberry Pi 5 is powered on. The multimeter injects a small test voltage during continuity checks, which can backfeed into the RP1 GPIO pins and cause erratic I2C bus behavior or temporary brownouts. Always power down and discharge capacitors before running continuity tests on the J8 header.

By relying on physical landmarks and verified voltage measurements rather than faded silkscreen or generic Fritzing diagrams, you ensure your sensor wiring survives the first power-on. For live software verification of your pin mappings, use the pinctrl utility pre-installed on Pi OS Bookworm, which queries the RP1 chip directly to show the real-time mux state of every GPIO pin.