Raspberry Pi — GPIO Pinout Quick Reference

Jul 14, 2026 11:55am · 3 views
raspberry pigpiopinoutreferencehardware1c3d
Markdown

Raspberry Pi — GPIO Pinout Quick Reference

All Raspberry Pi models with the 40-pin header (Pi 2, 3, 4, 5, Zero, Zero 2W) share the same GPIO pinout.

40-Pin Header Layout

Pins are numbered 1–40 left-to-right, top-to-bottom when the Pi is oriented with the USB ports facing down and the GPIO header at the top-right.

PhysicalBCMFunctionPhysicalBCMFunction
13.3V25V
32I2C SDA145V
53I2C SCL16GND
74GPIO4814UART TX
9GND1015UART RX
1117GPIO171218GPIO18 (PWM0)
1327GPIO2714GND
1522GPIO221623GPIO23
173.3V1824GPIO24
1910SPI MOSI20GND
219SPI MISO2225GPIO25
2311SPI CLK248SPI CE0
25GND267SPI CE1
270ID SDA281ID SCL
295GPIO530GND
316GPIO63212GPIO12 (PWM0)
3313GPIO13 (PWM1)34GND
3519SPI1 MISO3616GPIO16
3726GPIO263820SPI1 MOSI
39GND4021SPI1 CLK

Key Interfaces

InterfacePins (BCM)Notes
I2C (primary)SDA=2, SCL=33.3V, 400kHz fast mode
SPI (primary)MOSI=10, MISO=9, CLK=11, CE0=8, CE1=7
UARTTX=14, RX=15Disabled by default on Pi 3+ (used by Bluetooth)
PWMGPIO12, GPIO13, GPIO18, GPIO19Hardware PWM
3.3V powerPins 1, 17Max 50mA total
5V powerPins 2, 4Direct from power supply — use carefully
GNDPins 6, 9, 14, 20, 25, 30, 34, 39

Electrical Limits

  • All GPIO are 3.3V logic — never apply 5V to GPIO inputs
  • Max current per pin: 16mA (8mA recommended)
  • Max total GPIO current: 50mA
  • Use level shifters for 5V devices
  • Use transistors/MOSFETs for anything drawing more than 16mA

Quick Reference Commands

# Visual pinout diagram in terminal
pinout

# Read all GPIO states
raspi-gpio get

# Set GPIO 17 as output, drive high
raspi-gpio set 17 op dh

# Set GPIO 4 as input with pull-up
raspi-gpio set 4 ip pu

Links