The Raspberry Pi 3 (Model B, B+, and A+) utilizes a standard 40-pin GPIO header. Pin 1 is the 3.3V power rail, located on the side of the header closest to the SD card slot and the USB ports. When writing code, you must choose between BCM (Broadcom SoC channel numbers) and BOARD (physical pin numbers) numbering systems; BCM is the standard for Python libraries like gpiozero and modern C/C++ implementations, while BOARD is often used in legacy RPi.GPIO scripts.
Below is the definitive raspberry pi3 pinout reference. Bookmark this page for your workbench.
The Complete 40-Pin Raspberry Pi 3 Pinout Table
This table maps the physical header layout (left column = odd pins, right column = even pins) to the Broadcom (BCM) GPIO numbers and their primary default functions. Always verify your specific Pi 3 revision if using alternative SPI/I2C overlays.
| Phys | BCM | Name / Function | Mode | Phys | BCM | Name / Function | Mode |
|---|---|---|---|---|---|---|---|
| 1 | - | 3.3V Power | PWR | 2 | - | 5V Power | PWR |
| 3 | 2 | GPIO2 (SDA1) | I2C | 4 | - | 5V Power | PWR |
| 5 | 3 | GPIO3 (SCL1) | I2C | 6 | - | Ground | GND |
| 7 | 4 | GPIO4 (GPCLK0) | GPIO | 8 | 14 | GPIO14 (TXD0) | UART |
| 9 | - | Ground | GND | 10 | 15 | GPIO15 (RXD0) | UART |
| 11 | 17 | GPIO17 | GPIO | 12 | 18 | GPIO18 (PWM0) | PWM |
| 13 | 27 | GPIO27 | GPIO | 14 | - | Ground | GND |
| 15 | 22 | GPIO22 | GPIO | 16 | 23 | GPIO23 | GPIO |
| 17 | - | 3.3V Power | PWR | 18 | 24 | GPIO24 | GPIO |
| 19 | 10 | GPIO10 (MOSI0) | SPI | 20 | - | Ground | GND |
| 21 | 9 | GPIO9 (MISO0) | SPI | 22 | 25 | GPIO25 | GPIO |
| 23 | 11 | GPIO11 (SCLK0) | SPI | 24 | 8 | GPIO8 (CE0) | SPI |
| 25 | - | Ground | GND | 26 | 7 | GPIO7 (CE1) | SPI |
| 27 | 0 | GPIO0 (ID_SD) | EEPROM | 28 | 1 | GPIO1 (ID_SC) | EEPROM |
| 29 | 5 | GPIO5 | GPIO | 30 | - | Ground | GND |
| 31 | 6 | GPIO6 | GPIO | 32 | 12 | GPIO12 (PWM0) | PWM |
| 33 | 13 | GPIO13 (PWM1) | PWM | 34 | - | Ground | GND |
| 35 | 19 | GPIO19 (MISO1) | SPI/PWM | 36 | 16 | GPIO16 (CE2) | GPIO |
| 37 | 26 | GPIO26 | GPIO | 38 | 20 | GPIO20 (MOSI1) | SPI |
| 39 | - | Ground | GND | 40 | 21 | GPIO21 (SCLK1) | SPI |
Harness Wiring Color Codes and Regional Standards
When building permanent enclosures or wiring the Pi 3 to external sensors, relays, or mains-contactors, the jumper wires on your breadboard must transition to a structured harness. The color coding for these harnesses depends on your region and the governing electrical standard. While the Pi itself doesn't enforce a color code, adopting a strict standard prevents catastrophic cross-wiring when you open the enclosure six months later.
| Function | Dupont / Hobby Standard | IEC 60446 (EU / Global) | NEC / US DC Practice | Old UK (Pre-2004) |
|---|---|---|---|---|
| Ground (GND) | Black | Blue (DC) / Green-Yellow (Earth) | Black or White (Grounded) | Black |
| 3.3V Logic Power | Red (often confused with 5V) | Brown (DC+) | Red or Orange | Red |
| 5V Power Rail | Red | Orange or Yellow (DC+ High) | Red (if 3.3V is Orange) | Yellow |
| I2C Data (SDA) | Blue | Green | Green | Green |
| I2C Clock (SCL) | Yellow | White or Grey | White or Blue/White | White |
Which standard applies to you? If you are building a consumer product for the European market, your internal DC harness must follow IEC 60446 guidelines (Brown for positive, Blue for negative/ground). If you are in the US and wiring a custom control panel, NEC-style DC practice (often Red/Black or Orange/Black depending on voltage tier) is standard. For pure hobbyist bench work, the Dupont standard (Red=VCC, Black=GND) is universally understood, but you must explicitly differentiate 3.3V (use Orange) from 5V (use Red) to avoid frying 3.3V sensors.
Rows People Get Wrong (and How to Avoid Bricking Your Pi)
The Raspberry Pi 3's BCM2837 SoC is strictly a 3.3V logic device. Feeding 5V into any GPIO pin (except the dedicated 5V power pins) will instantly destroy the SoC's ESD protection diodes and permanently brick the board. Here are the specific rows and scenarios where builders make fatal mistakes:
1. The 3.3V vs 5V Power Rail Confusion (Pins 1, 2, 4, 17)
Pin 1 and Pin 17 output 3.3V. Pins 2 and 4 output 5V. When wiring a sensor that requires 5V (like an ultrasonic HC-SR04), you must power it from Pin 2 or 4. However, the echo pin from that sensor will output 5V. You must use a voltage divider (e.g., 1kΩ and 2kΩ resistors) to drop the 5V echo signal down to 3.3V before it hits the Pi's GPIO input pin. Plugging a 5V echo directly into BCM 23 will kill the pin.
2. UART TX/RX Crossover (Pins 8 and 10)
Pin 8 is TXD (Transmit) and Pin 10 is RXD (Receive). When connecting the Pi to a microcontroller (like an Arduino or ESP32), you must cross the lines: Pi TX (Pin 8) goes to the external device's RX, and Pi RX (Pin 10) goes to the external device's TX. Furthermore, ensure the external device is also running at 3.3V logic. Connecting a 5V Arduino's TX directly to the Pi's RX (Pin 10) will fry the Pi.
3. I2C Missing Pull-Up Resistors (Pins 3 and 5)
Pins 3 (SDA) and 5 (SCL) are the primary I2C bus. The Raspberry Pi 3 includes 1.8kΩ hardware pull-up resistors to 3.3V on these pins on the PCB itself. If you are wiring multiple I2C devices, do not add external pull-up resistors to your sensor breakouts unless you have disabled the onboard ones (which requires PCB trace cutting). Adding parallel pull-ups lowers the equivalent resistance, causing the I2C bus to fail due to excessive current draw and signal distortion.
4. The EEPROM ID Pins (Pins 27 and 28)
Pins 27 (GPIO0) and 28 (GPIO1) are reserved for the HAT (Hardware Attached on Top) identification EEPROM. Do not use these for general-purpose I/O in your scripts. The Pi's bootloader queries these pins on startup to auto-configure GPIO states. Toggling them in your Python code can cause boot failures if a HAT is attached.
Safe Interpretation and Debugging Faded Boards
In industrial or outdoor environments, the white silkscreen text on the Raspberry Pi 3 PCB can fade, or the header might be obscured by a ribbon cable or a tightly fitted HAT. When you cannot read the pin labels, you must rely on physical board markers and multimeter verification to safely interpret the pinout.
Finding Pin 1 Without Silkscreen
- The Square Pad Rule: Flip the Pi over (or look closely at the base of the header pins). Pin 1 is always indicated by a square copper pad on the PCB, while all other pins (2 through 40) have round copper pads.
- The Component Edge Rule: Pin 1 is always on the row closest to the main SoC chip, and it is the pin closest to the SD card slot / USB ports edge of the board.
- The Triangle Marker: On some third-party Pi 3 clones and early B+ revisions, a tiny white triangle is printed on the PCB next to Pin 1, pointing directly at it.
Verifying Rails with a Multimeter
Never guess power rails on an unmarked or obscured board. Before connecting sensitive 3.3V logic, perform a live verification:
- Power the Pi via its micro-USB port.
- Set your digital multimeter (DMM) to DC Voltage.
- Place the black probe on a known ground (the metal shielding of the USB ports is grounded and provides a large, safe contact area).
- Probe the suspected Pin 1. It should read between 3.28V and 3.32V. If it reads ~5.0V, you are on Pin 2 or 4. If it reads 0V, you are on a GND pin or the board is unpowered.
For interactive software verification, you can always run pinout in the Raspberry Pi OS terminal. This built-in utility prints an ASCII art diagram of the raspberry pi3 pinout directly to your SSH session, providing a reliable digital reference when the physical board is buried inside an enclosure. For deeper hardware debugging and overlay configuration, consult the official Raspberry Pi GPIO documentation and community resources like Pinout.xyz.






