The standard Raspberry Pi (Models B+, 2, 3, 4, and 5) uses a 40-pin GPIO header. Pin 1 provides 3.3V, Pin 2 provides 5V, and Pin 6 is Ground. When orienting the board with the USB ports facing you and the GPIO header on the top right, Pin 1 is the top-left corner. Unlike mains wiring where regional codes dictate color and position, Raspberry Pi pinouts are governed by Broadcom silicon mappings and physical header layouts. Misinterpreting these standards is the leading cause of dead System-on-Chips (SoCs) on the workbench.

The Complete 40-Pin Raspberry Pi Pinouts Reference Table

This table maps the physical header layout to the Broadcom (BCM) silicon pins and their default alternate functions. Read it left-to-right, matching the physical pins on your board.

Left Bank (Odd) Function / BCM Function / BCM Right Bank (Even)
13.3V Power5V Power2
3GPIO2 (SDA1 / I2C)5V Power4
5GPIO3 (SCL1 / I2C)Ground6
7GPIO4 (GPCLK0)GPIO14 (TXD / UART)8
9GroundGPIO15 (RXD / UART)10
11GPIO17GPIO18 (PWM0)12
13GPIO27Ground14
15GPIO22GPIO2316
173.3V PowerGPIO2418
19GPIO10 (MOSI / SPI0)Ground20
21GPIO9 (MISO / SPI0)GPIO2522
23GPIO11 (SCLK / SPI0)GPIO8 (CE0 / SPI0)24
25GroundGPIO7 (CE1 / SPI0)26
27GPIO0 (ID_SD / I2C)GPIO1 (ID_SC / I2C)28
29GPIO5Ground30
31GPIO6GPIO12 (PWM0)32
33GPIO13 (PWM1)Ground34
35GPIO19 (MISO1 / SPI1)GPIO16 (CE2 / SPI1)36
37GPIO26GPIO20 (MOSI1 / SPI1)38
39GroundGPIO21 (SCLK1 / SPI1)40
Pro-Tip for Hardware Debugging: Pins 3, 5, 8, 10, 19, 21, 23, 24, and 26 have fixed 1.8kΩ pull-up resistors to 3.3V on the silicon. If you are wiring open-drain sensors or I2C devices, these pins save you from adding external pull-up resistors to your breadboard.

Numbering Standards: BCM vs. Physical vs. Board

In mains electrical work, you follow NEC or IEC color codes. In the embedded world, the "standards" are software numbering schemes. Choosing the wrong one in your code will result in toggling the wrong physical pin, which can be catastrophic if that physical pin is connected to a high-current load.

  • BCM (Broadcom SOC Channel): This maps directly to the internal silicon pin numbers of the Broadcom BCM2711 (Pi 4) or BCM2712 (Pi 5). For example, Physical Pin 3 is BCM GPIO2. This is the native language of the hardware.
  • BOARD (Physical): This simply counts the physical pins 1 through 40. Physical Pin 3 is BOARD Pin 3. It ignores the silicon mapping entirely.
  • WiringPi: An older, deprecated numbering scheme created before the 40-pin header was standardized. Do not use this in 2026. The library is unmaintained and will cause mapping errors on Pi 4 and Pi 5 boards.

For authoritative visual mapping and real-time pin state checking, the community standard reference is Pinout.xyz, which provides interactive overlays for every official Pi board and HAT.

Board Variants and Faded Markings

While the 40-pin header has been standard since the Model B+ in 2014, you will encounter variants in the wild. Here is how to safely interpret them when silkscreen markings are faded or missing.

The 26-Pin Rev 1 Anomaly

The original 2012 Raspberry Pi Model B Rev 1 only had 26 pins. More dangerously, the I2C bus mapping was swapped. On Rev 1, Physical Pins 3 and 5 map to I2C Bus 0, whereas on all modern 40-pin boards, they map to I2C Bus 1. If you are salvaging an old Rev 1 board, your I2C Python scripts will fail silently unless you explicitly call Bus 0.

Raspberry Pi Pico (RP2040/RP2350)

The Pi Pico is a microcontroller, not a single-board computer, and its pinout is entirely different. It uses castellated edge pads numbered 1 through 40, but Pin 1 is not 3.3V. On the Pico, Pin 1 is GP0, and the 3.3V output is on Pin 36. Never assume a 40-pin footprint means the standard Pi GPIO map applies.

Faded Markings Recovery: If the silkscreen on your GPIO header is worn off, flip the board over. Pin 1 is always indicated by a square solder pad on the underside of the PCB, while all other pins have round pads. Alternatively, on standard Pi boards, Pin 1 is the pin closest to the SD card slot edge on the inner row.

Rows People Get Wrong (And How They Fry Boards)

Based on years of bench troubleshooting, these are the specific pinout misinterpretations that destroy hardware.

1. The 3.3V vs 5V Power Rail Swap (Pins 1 & 2)

The Broadcom SoC operates strictly at 3.3V logic. Pin 1 provides 3.3V, and Pin 2 provides 5V. If you accidentally wire a 5V sensor output into a BCM GPIO pin, or worse, back-feed 5V into the 3.3V rail (Pin 1), you will instantly blow the internal voltage regulator or fry the SoC silicon. Always double-check Pin 1 orientation before applying power.

2. UART TX/RX Crossover (Pins 8 & 10)

Physical Pin 8 is TXD (Transmit) and Pin 10 is RXD (Receive). When wiring a serial GPS module or an Arduino via UART, beginners often wire TX to TX and RX to RX. Serial communication requires a crossover: the Pi’s TX (Pin 8) must connect to the peripheral’s RX, and the Pi’s RX (Pin 10) must connect to the peripheral’s TX.

3. The HAT EEPROM Pins (Pins 27 & 28)

Pins 27 (GPIO0/ID_SD) and 28 (GPIO1/ID_SC) are reserved for the HAT (Hardware Attached on Top) identification EEPROM. The Pi uses these during boot to read the HAT’s power requirements and automatically configure GPIO drive strengths. Do not use these pins for general-purpose I/O or secondary I2C sensors; doing so can cause boot loops or I2C bus collisions.

Decision Path: Choosing Your Pinout Strategy

Stop guessing which numbering scheme to use. Follow this decision matrix to lock in your configuration for both code and physical wiring.

Scenario / Toolchain Required Standard Why
Writing Python with gpiozero or RPi.GPIO BCM Native library support; matches official Raspberry Pi documentation and datasheets.
Designing a custom PCB or wiring harness Physical (BOARD) Manufacturers drill holes based on physical 1-40 spacing (2x20 grid, 2.54mm pitch).
Using C/C++ with pigpio or lgpio BCM Low-level memory mapping requires direct Broadcom silicon addresses.
Porting legacy Arduino code Physical (BOARD) Arduino uses physical board pin numbers (D0-D13); mapping physical Pi pins reduces cognitive load.

The Default Recommendation: If you are starting a new project today, use BCM for all software code and use Physical numbering for your physical wiring diagrams and silkscreen labels. This aligns with the official Raspberry Pi hardware documentation and prevents the translation errors that occur when trying to map physical pins to software variables in your head. Always define your pins as constants at the top of your script (e.g., LED_PIN_BCM = 17) to bridge the gap between the physical wire on Pin 11 and the software logic.