The Raspberry Pi 3 Model B pinout consists of a 40-pin header featuring 26 general-purpose I/O (GPIO) pins, 2 I2C buses, 2 SPI buses, 1 UART interface, and 8 power/ground pins. The default and most widely supported numbering standard is BCM (Broadcom SOC channel) numbering, though Physical (BOARD) pin numbering is also available depending on your software library. All GPIO pins operate at strictly 3.3V logic; applying 5V to any data pin will permanently destroy the BCM2837 SoC.

The Complete Raspberry Pi 3 Model B Pinout Table

Below is the definitive 40-pin reference. Use this table to map physical header locations to their Broadcom (BCM) GPIO equivalents and alternate functions. For interactive visual mapping, cross-reference with the community-standard pinout.xyz database.

Phys BCM Name / Function Phys BCM Name / Function
1-3.3V Power2-5V Power
32GPIO2 (I2C1 SDA)4-5V Power
53GPIO3 (I2C1 SCL)6-Ground
74GPIO4 (GPCLK0)814GPIO14 (UART0 TX)
9-Ground1015GPIO15 (UART0 RX)
1117GPIO171218GPIO18 (PWM0)
1327GPIO2714-Ground
1522GPIO221623GPIO23
17-3.3V Power1824GPIO24
1910GPIO10 (SPI0 MOSI)20-Ground
219GPIO9 (SPI0 MISO)2225GPIO25
2311GPIO11 (SPI0 SCLK)248GPIO8 (SPI0 CE0)
25-Ground267GPIO7 (SPI0 CE1)
270GPIO0 (I2C0 ID_SD)281GPIO1 (I2C0 ID_SC)
295GPIO530-Ground
316GPIO63212GPIO12 (PWM0)
3313GPIO13 (PWM1)34-Ground
3519GPIO19 (SPI1 MISO)3616GPIO16 (SPI1 CE2)
3726GPIO263820GPIO20 (SPI1 MOSI)
39-Ground4021GPIO21 (SPI1 SCLK)

BCM vs. BOARD: Which Numbering Standard Applies?

Unlike industrial PLCs that use fixed hardware addressing, the Pi's software ecosystem allows two distinct mapping standards. Choosing the wrong one is the leading cause of "my sensor isn't responding" support tickets.

Standard Selection Rule: Always default to BCM numbering unless your specific framework forces BOARD numbering. BCM maps directly to the Broadcom SoC datasheet, making it universal across Python, C, and bash scripting.
  • BCM (Broadcom SOC Channel): Uses the internal GPIO numbers (e.g., GPIO17). This is the native standard for the RPi.GPIO and gpiozero Python libraries, as well as the official Raspberry Pi Foundation documentation.
  • BOARD (Physical): Uses the physical pin numbers (1 through 40). This is often the default in Node-RED, some Scratch implementations, and older wiringPi C libraries. It ignores the actual silicon routing.

If you wire a relay to Physical Pin 11 but tell your Python script to toggle GPIO(11) in BCM mode, the script will actually toggle Physical Pin 23 (which is BCM 11). Always declare your mode explicitly at the top of your script: GPIO.setmode(GPIO.BCM).

Rows People Get Wrong (And How to Avoid Bricking Your Pi)

The 40-pin header is unforgiving. There is no onboard polyfuse protecting the data lines from overvoltage. Here are the specific rows where builders consistently make catastrophic or functional errors.

Critical Voltage Warning: The Raspberry Pi 3 Model B is a strictly 3.3V logic device. Connecting a 5V sensor output (like an HC-SR04 ultrasonic echo pin or an Arduino Uno TX line) directly to any BCM GPIO pin will inject current backward through the SoC's protection diodes, permanently frying the chip. Always use a bidirectional logic level converter (e.g., BSS138 MOSFET-based modules) for 5V-to-3.3V translation.

Pin 1 (3.3V) vs. Pin 2 (5V)

Pin 1 outputs a regulated 3.3V (max draw ~50mA). Pin 2 outputs raw 5V from the USB power input. Plugging a 5V sensor's VCC into Pin 1 will cause brownouts and system reboots. Plugging a 3.3V sensor's VCC into Pin 2 will instantly destroy the sensor. Always trace your power wires with a multimeter before applying power.

Pins 27 & 28 (ID_SD and ID_SC)

These pins are physically located next to the 3.3V rail. They are reserved for the HAT (Hardware Attached on Top) EEPROM I2C bus. The Pi uses these during boot to read HAT configuration data. Do not use these for standard I2C sensors; use Pins 3 and 5 (I2C1) instead. Pulling these low during boot can prevent the Pi from initializing HATs correctly.

Pins 8 & 10 (UART TX/RX)

These are 3.3V TTL serial pins, not RS-232. If you are connecting a GPS module or a cellular modem, ensure the module's TX line does not exceed 3.3V. Furthermore, by default, the Pi 3 uses this UART for the serial console. You must disable the serial console in raspi-config (Interface Options -> Serial Port -> Disable Login Shell, Enable Hardware) before using these pins for sensor data.

Safe Interpretation When Silk Screen Markings Are Faded

On older Pi 3 Model B boards, or boards exposed to high ambient heat and flux residue, the white silk-screen pin numbers can fade or flake off. If you lose your pinout reference, use these physical landmarks to safely orient the header:

  1. The Square Pad: Pin 1 is the only pin on the entire header with a square copper pad on the PCB underside. All other pins have round pads. Flip the board over to verify.
  2. Component Proximity: Pin 1 is located closest to the edge of the board where the microSD card slot resides, and furthest from the USB/Ethernet block.
  3. Power Bank Orientation: The two pins closest to the USB power input micro-plug are Pin 2 (5V) and Pin 4 (5V). Pin 1 (3.3V) and Pin 3 (SDA) are on the opposite side of that same row.

Decision Path: Choosing the Right Interface for Your Sensor

Don't just pick a random GPIO pin. Match your sensor's protocol to the Pi's dedicated hardware peripherals to offload processing from the CPU. Use this decision tree to select your exact pins.

Sensor / Device Type Required Protocol Concrete Pin Pick (Physical) Why This Pick?
Temperature/Humidity (BME280), OLED Displays, IMUs (MPU6050) I2C 3 (SDA) & 5 (SCL) Hardware I2C1 bus. Includes onboard 1.8kΩ pull-up resistors to 3.3V. Supports up to 400kHz Fast Mode.
SD Cards, High-speed ADCs (MCP3008), RFID (RC522) SPI 19 (MOSI), 21 (MISO), 23 (SCLK), 24 (CE0) Hardware SPI0 bus. Capable of 125MHz (though practically limited to ~30MHz for stable wiring). CE0 is hardware Chip Select 0.
GPS Modules, ESP8266 AT-command Wi-Fi, PZEM-004T Energy Meters UART (Serial) 8 (TX) & 10 (RX) Hardware UART0 (PL011). Provides stable baud rates without the jitter of software serial. Remember to cross-wire (Pi TX to Sensor RX).
Servos, LED Dimming, DC Motor Speed Control PWM 12 (PWM0) or 33 (PWM1) Hardware PWM channels. Software PWM on other pins causes servo jitter due to Linux OS thread scheduling latency.
Push Buttons, PIR Motion Sensors, Relays Digital I/O 11, 13, 15, or 16 Standard GPIOs with no default alternate functions assigned at boot, reducing the risk of startup glitches triggering your relays.
Default Recommendation: If your sensor supports both I2C and SPI (like many Bosch environmental sensors), choose I2C on Pins 3 and 5. It requires only two data wires (plus power/ground) compared to SPI's four, and the Pi 3's I2C1 bus includes built-in pull-up resistors, saving you from soldering external resistor networks.