The "Raspberry Pi pinout 3" refers to the Revision 3 40-pin GPIO header layout. Introduced with the Pi 1 Model B+ and standardized across the Pi 2, Pi 3, Pi 4, and Pi 5, this layout is the foundation for almost all modern Pi hardware projects. If you are wiring sensors, relays, or HATs, you need to know exactly which physical pin maps to which Broadcom (BCM) GPIO channel. Here is the complete reference.
The Complete Raspberry Pi Pinout 3 (40-Pin GPIO) Reference Table
The table below maps the physical board pins (1-40) to their Broadcom SoC channel numbers (BCM) and primary functions. Read the left side for odd pins (1-39) and the right side for even pins (2-40).
| Phys | BCM | Function / Name | Phys | BCM | Function / Name |
|---|---|---|---|---|---|
| 1 | - | 3.3V Power | 2 | - | 5V Power |
| 3 | 2 | SDA1 (I2C1) | 4 | - | 5V Power |
| 5 | 3 | SCL1 (I2C1) | 6 | - | Ground (GND) |
| 7 | 4 | GPIO 4 (GPCLK0) | 8 | 14 | TXD (UART0) |
| 9 | - | Ground (GND) | 10 | 15 | RXD (UART0) |
| 11 | 17 | GPIO 17 | 12 | 18 | GPIO 18 (PWM0) |
| 13 | 27 | GPIO 27 | 14 | - | Ground (GND) |
| 15 | 22 | GPIO 22 | 16 | 23 | GPIO 23 |
| 17 | - | 3.3V Power | 18 | 24 | GPIO 24 |
| 19 | 10 | MOSI (SPI0) | 20 | - | Ground (GND) |
| 21 | 9 | MISO (SPI0) | 22 | 25 | GPIO 25 |
| 23 | 11 | SCLK (SPI0) | 24 | 8 | CE0 (SPI0) |
| 25 | - | Ground (GND) | 26 | 7 | CE1 (SPI0) |
| 27 | 0 | ID_SD (I2C ID) | 28 | 1 | ID_SC (I2C ID) |
| 29 | 5 | GPIO 5 | 30 | - | Ground (GND) |
| 31 | 6 | GPIO 6 | 32 | 12 | GPIO 12 (PWM0) |
| 33 | 13 | GPIO 13 (PWM1) | 34 | - | Ground (GND) |
| 35 | 19 | GPIO 19 (PWM1) | 36 | 16 | GPIO 16 |
| 37 | 26 | GPIO 26 | 38 | 20 | GPIO 20 |
| 39 | - | Ground (GND) | 40 | 21 | GPIO 21 |
Decoding the Standards: BCM vs. Physical vs. WiringPi
When writing code for the Raspberry Pi, the physical pin numbers on the board rarely match the numbers you type into your Python or C scripts. This discrepancy causes 90% of beginner hardware bugs. Here is how the three primary numbering standards break down and which one you should use.
| Standard | How it Numbers Pins | Primary Use Case | Library Example |
|---|---|---|---|
| BCM (Broadcom) | Uses the SoC channel numbers (e.g., GPIO 17) | Modern Python scripting, production code | gpiozero, RPi.GPIO (mode BCM) |
| BOARD (Physical) | Uses the physical pin location (1 through 40) | Beginners, direct wiring translation | RPi.GPIO (mode BOARD) |
| WiringPi | Custom sequential mapping (0 through 31) | Legacy C/C++ projects, older tutorials | wiringPi (deprecated in 2019) |
Which standard applies to you? If you are writing Python in 2026, use the BCM standard via the gpiozero library. It is the officially recommended standard by the Raspberry Pi Foundation. Physical (BOARD) numbering is only recommended if you are using a physical overlay cheat-sheet on your desk and want to avoid translating numbers in your head. WiringPi is effectively dead; if you are following a C++ tutorial that uses WiringPi, look for modern alternatives like lgpio or pigpio.
The "Rows People Get Wrong" and Faded Board Recovery
Not all GPIO pins are created equal. The Raspberry Pi SoC assigns alternate functions to specific pins, and ignoring these hardware-level quirks will result in erratic sensor readings or damaged components.
Rows People Get Wrong
- Row 2 (Pins 3 & 5 / BCM 2 & 3): These are the I2C1 SDA and SCL lines. They have 1.8kΩ hardware pull-up resistors permanently tied to the 3.3V rail on the Pi board. If you configure these as standard GPIO outputs and drive them LOW, you will create a direct short through the pull-up resistor, potentially damaging the SoC's 3.3V regulator.
- Row 4 (Pins 8 & 10 / BCM 14 & 15): These are the primary UART TX/RX pins. On the Pi 3, 4, and 5, the primary UART is multiplexed with the onboard Bluetooth module. If you need a stable hardware UART for a GPS module or serial console, you must disable Bluetooth in
/boot/config.txt(dtoverlay=disable-bt) or use the software "mini UART" on BCM 18/19. - Row 6 & 17 (Pins 12, 32, 33, 35 / BCM 18, 12, 13, 19): These are your Hardware PWM pins. If you are driving a servo motor or dimming an LED and experiencing jitter, ensure you are using one of these specific BCM channels. Standard software PWM on other pins will stutter under CPU load.
- Row 14 (Pins 27 & 28 / BCM 0 & 1): Reserved for HAT (Hardware Attached on Top) EEPROM identification via a dedicated I2C bus. Do not use these for general-purpose I/O unless you are not stacking a HAT.
Safe Interpretation When Markings are Faded or Missing
If you are working with a used Pi 3, a clone board, or a heavily fluxed board where the silkscreen pin numbers have rubbed off, do not guess. Misidentifying Pin 1 and plugging 5V into a GPIO will instantly fry the Broadcom SoC.
- Locate the Square Pad: Flip the board over. Look at the solder joints for the GPIO header. Pin 1 always has a square solder pad, while all other pins have circular pads.
- Physical Orientation: With the USB ports facing you and the GPIO header at the top-left, Pin 1 is the top-left pin (closest to the USB ports and the microSD slot).
- Verify with a Multimeter: Power the board via USB-C or micro-USB. Set your multimeter to DC Voltage. Place the black probe on the metal shield of a USB port (Ground). Probe the top-left pin: it should read 3.3V. The pin immediately to its right (Pin 2) should read 5.0V. If you read 5V on the top-left pin, your header is installed backward or you are looking at a non-standard clone board.
Standard Wiring Colors and 5V Tolerance Warnings
When wiring up a Pi, establishing a strict color code for your jumper wires or ribbon cables prevents catastrophic mistakes during debugging. While the NEC and IEC standards govern mains and DC power wiring in industrial settings, hobbyist bench wiring relies on de-facto standard ribbon cable color codes.
The Raspberry Pi GPIO pins operate strictly at 3.3V logic levels. They are NOT 5V tolerant. Feeding a 5V signal from an Arduino Uno, a standard HC-SR04 ultrasonic sensor, or an unregulated power supply directly into any BCM GPIO pin will destroy the pin's clamping diodes and likely kill the entire SoC. Always use a logic level shifter (like a BSS138 MOSFET module) or a voltage divider (e.g., 2kΩ and 3.3kΩ resistors) when interfacing 5V sensors with the Pi.
Recommended Bench Color Codes
| Wire Color | Assigned Function | Notes |
|---|---|---|
| Red | 5V Power (Pins 2, 4) | Use 22 AWG or thicker for high-current loads like LED strips. |
| Orange | 3.3V Power (Pins 1, 17) | Max draw is typically ~50mA total across all 3.3V pins. |
| Black | Ground (GND) | Always connect Pi GND to the GND of external power supplies. |
| Blue | I2C Data (SDA) | Paired with Yellow (SCL). Keep runs under 1 meter. |
| Green | SPI / UART Data | Use for MOSI/MISO or TX/RX lines. |
| Yellow | General GPIO / Signals | Standard logic-level signal wires. |
For authoritative details on alternate pin functions and SoC-level multiplexing, always refer to the official Raspberry Pi GPIO Documentation. When designing custom HATs or permanent wiring harnesses, verify your pin mappings against the specific board revision you are using, as the Pi 5 introduced a dedicated debug UART connector and altered some power delivery behaviors compared to the Pi 3 and 4.






