The Raspberry Pi 3 B+ features a 40-pin GPIO header. Pin 1 outputs 3.3V, Pin 2 outputs 5V, and Pin 6 is Ground. The board operates strictly on 3.3V CMOS logic; feeding 5V into any GPIO pin (except the dedicated 5V power rails) will permanently destroy the SoC. Below is the complete physical and BCM mapping, followed by the critical wiring standards and decision paths you need to wire your next project without bricking the board.

The Complete 40-Pin GPIO Reference Table

This table maps the physical header layout (looking down at the Pi with USB ports facing you and the GPIO header on the top left). The left column represents the odd-numbered pins (closest to the board edge), and the right column represents the even-numbered pins.

Phys BCM / Function (Left Bank) BCM / Function (Right Bank) Phys
13.3V Power (Max 50mA draw)5V Power (Main USB input rail)2
3GPIO 2 (I2C1 SDA) - 1.8kΩ pull-up5V Power4
5GPIO 3 (I2C1 SCL) - 1.8kΩ pull-upGround6
7GPIO 4 (GPCLK0)GPIO 14 (UART0 TXD)8
9GroundGPIO 15 (UART0 RXD)10
11GPIO 17 (Standard GPIO)GPIO 18 (Hardware PWM0)12
13GPIO 27 (Standard GPIO)Ground14
15GPIO 22 (Standard GPIO)GPIO 23 (Standard GPIO)16
173.3V PowerGPIO 24 (Standard GPIO)18
19GPIO 10 (SPI0 MOSI)Ground20
21GPIO 9 (SPI0 MISO)GPIO 25 (Standard GPIO)22
23GPIO 11 (SPI0 SCLK)GPIO 8 (SPI0 CE0)24
25GroundGPIO 7 (SPI0 CE1)26
27ID_SD (HAT EEPROM I2C)ID_SC (HAT EEPROM I2C)28
29GPIO 5 (Standard GPIO)Ground30
31GPIO 6 (Standard GPIO)GPIO 12 (Hardware PWM0)32
33GPIO 13 (Hardware PWM1)Ground34
35GPIO 19 (SPI1 MISO / PWM1)GPIO 16 (Standard GPIO)36
37GPIO 26 (Standard GPIO)GPIO 20 (SPI1 MOSI)38
39GroundGPIO 21 (SPI1 SCLK)40

Numbering Standards and DC Wiring Color Codes

When programming and wiring the Pi, you are navigating two distinct standard ecosystems: software pin numbering and physical wire color coding. Using the wrong standard in your code will map your logic to the wrong physical pin; using the wrong wire colors will cause catastrophic confusion during troubleshooting.

Standard Where it Applies Rule of Thumb
BCM (Broadcom) Python (RPi.GPIO, gpiozero), C/C++ (pigpio), Device Trees Use this for 95% of software projects. Maps directly to the SoC datasheet.
Physical (Board) Breadboarding, wiring diagrams, multimeter probing Use this when physically counting pins from the corner. 1-40 sequential.
WiringPi Legacy C libraries, older Arduino-ported code Deprecated. Avoid unless maintaining legacy codebases from pre-2019.
DC Wiring Color Codes (IEC vs. NEC): When building custom power harnesses for the Pi's 5V and GND rails (Pins 2/4 and 6/9), regional standards diverge. In the US, NEC-style DC practice typically uses Red for Positive (+) and Black for Negative/Ground (-). However, under IEC 60446 (common in the EU/UK), DC power wiring dictates Brown for Positive (+) and Blue for Negative (-). Pick one standard for your bench and stick to it; mixing Red/Black and Brown/Blue in the same harness is a leading cause of reversed-polarity shorts.

Rows People Get Wrong (And How They Brick Their Pi)

The Raspberry Pi 3 B+ lacks overvoltage protection on its GPIO pins (unlike the earlier Pi 1 Model A which had polyfuses on some lines). Here are the specific pins that cause hardware failures when misinterpreted.

  • The 3.3V vs 5V Swap (Pins 1 & 2): Pin 1 is the 3.3V regulator output. It can only supply about 50mA. Pin 2 is tied directly to the 5V USB input rail and can supply amps (limited only by your power supply and the board's polyfuse). If you accidentally wire a 5V sensor's VCC to Pin 1, you will brownout the 3.3V regulator and crash the Pi. If you wire a 3.3V logic input to Pin 2, you will instantly fry the SoC.
  • The I2C Pull-Up Trap (Pins 3 & 5 / GPIO 2 & 3): These pins are hardwired to the 3.3V rail through 1.8kΩ resistors on the Pi's PCB. They are meant for 3.3V I2C devices. If you connect a 5V I2C device here without a level shifter, the 5V device will back-feed 5V through the Pi's 1.8kΩ pull-ups directly into the BCM2837 SoC, destroying the I2C controller.
  • The UART Boot Loop (Pins 8 & 10 / GPIO 14 & 15): By default, the Pi outputs a serial console boot log to GPIO 14 (TXD) and listens for a serial terminal on GPIO 15 (RXD). If you wire a sensor to these pins, the boot-time data burst will spam your sensor with garbage data, and your sensor's output might interrupt the Pi's bootloader, causing a boot loop. Disable the serial console in raspi-config before using these as standard GPIOs.
  • The HAT ID Pins (Pins 27 & 28): These are reserved for reading the EEPROM on official Raspberry Pi HATs. They are not broken out to standard BCM GPIO numbers in the OS and should never be used for general-purpose wiring.

Safe Interpretation When Markings Are Faded or Missing

On older or heavily used Pi 3 B+ boards, the silkscreen "P1" marker or pin numbering on the PCB can wear off, especially if the board has been housed in a tight enclosure or exposed to flux residue. If you cannot read the board markings, use these physical landmarks to safely identify Pin 1:

  1. The Square Pad Rule: Flip the board over and look at the solder joints on the bottom of the PCB. Pin 1 is the only pin with a square copper solder pad. All other 39 pins have perfectly round solder pads.
  2. The USB Orientation Method: Place the Pi flat on your bench with the four USB/Ethernet ports facing toward your stomach and the SD card slot pointing away from you. The GPIO header is on the left. Pin 1 is the top-left corner pin, closest to the SD card slot.
  3. The Triangle Indicator: Look closely at the plastic shroud of the male header itself (not the PCB). Many header manufacturers mold a tiny triangle into the plastic base near Pin 1. Use a magnifying glass and a bright light to check the plastic base.

Pin Selection Decision Tree

Do not just pick random pins for your next project. Use this decision path to select the correct hardware block for your specific sensor or actuator. Follow the tree down to terminate on a concrete pin assignment.

Start Here: What is the electrical requirement of your peripheral?
  • IF you need true hardware PWM (for smooth servo control or LED dimming without CPU jitter) You must use GPIO 12, 13, 18, or 19. (Pick GPIO 18 / Pin 12 as the default, as it shares the PWM0 channel with GPIO 12 but is physically easier to route on standard HATs).
  • IF you are wiring an I2C sensor (BME280, OLED display) You must use GPIO 2 (SDA) and GPIO 3 (SCL). Ensure your sensor is 3.3V native or uses a bidirectional logic level shifter (like the BSS138).
  • IF you are wiring an SPI device (SD card module, RFID RC522) Use the primary SPI0 bus: GPIO 11 (SCLK), GPIO 10 (MOSI), GPIO 9 (MISO), and GPIO 8 (CE0).
  • IF you are debugging via serial console to a PC Use GPIO 14 (TX) and GPIO 15 (RX). Remember: TX connects to the PC's RX, and RX connects to the PC's TX. Never connect TX to TX.
  • IF you just need a basic digital input/output (push button, relay module, PIR sensor) and want to avoid all boot-sequence conflicts, alternate functions, and hardware pull-ups Use BCM GPIO 17 (Physical Pin 11). It is the safest, most isolated general-purpose pin on the entire 40-pin header.

For comprehensive schematic data and official tolerance thresholds, always cross-reference your wiring with the official Raspberry Pi GPIO documentation and interactive maps like Pinout.xyz before applying power to a new harness.