Raspberry Pi โ€” GPIO Pinout Quick Reference

Jul 14, 2026 11:55am · 115 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
1โ€”3.3V2โ€”5V
32I2C SDA14โ€”5V
53I2C SCL16โ€”GND
74GPIO4814UART TX
9โ€”GND1015UART RX
1117GPIO171218GPIO18 (PWM0)
1327GPIO2714โ€”GND
1522GPIO221623GPIO23
17โ€”3.3V1824GPIO24
1910SPI MOSI20โ€”GND
219SPI MISO2225GPIO25
2311SPI CLK248SPI CE0
25โ€”GND267SPI CE1
270ID SDA281ID SCL
295GPIO530โ€”GND
316GPIO63212GPIO12 (PWM0)
3313GPIO13 (PWM1)34โ€”GND
3519SPI1 MISO3616GPIO16
3726GPIO263820SPI1 MOSI
39โ€”GND4021SPI1 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