Raspberry Pi GPIO (General Purpose Input/Output) pins provide the hardware interface between the Pi and the physical world. The 40-pin header supports digital I/O, I2C, SPI, UART, PWM, and power rails. Understanding BCM vs physical numbering prevents wiring mistakes that can damage the board.
40-Pin GPIO Header (Pi 4 / Pi 5)
| Pin # | BCM | Name | Functions | Notes |
|---|
Electrical Limits
- Logic level: 3.3V (NOT 5V tolerant)
- Max per GPIO: 16 mA
- Max total GPIO: 50 mA
- 3.3V rail: ~50 mA available
- 5V rail: limited by PSU
I2C Addresses
- SDA: GPIO2 (Pin 3)
- SCL: GPIO3 (Pin 5)
- Built-in 1.8kΩ pull-ups
- Default speed: 100 kHz
- Fast mode: 400 kHz
SPI0 Pins
- MOSI: GPIO10 (Pin 19)
- MISO: GPIO9 (Pin 21)
- SCLK: GPIO11 (Pin 23)
- CE0: GPIO8 (Pin 24)
- CE1: GPIO7 (Pin 26)
How to Use the Raspberry Pi GPIO Reference
This Raspberry Pi GPIO reference covers the complete 40-pin header pinout for Pi 4 and Pi 5. Use the search box or filter buttons to quickly find pins by function. Click any row for pin details.
BCM vs Physical Numbering
Python's RPi.GPIO library defaults to BCM numbering. Physical numbering counts from pin 1 (top-left, next to the 3.3V corner) to pin 40 (bottom-right). GPIO.setmode(GPIO.BCM) uses BCM numbers. GPIO.setmode(GPIO.BOARD) uses physical numbers. Mixing the two is a common wiring mistake.
Protecting GPIO Pins
GPIO pins operate at 3.3V — never connect 5V signals directly. For 5V sensors and displays: use a voltage divider (two resistors) or a level shifter IC. For motors or relays (high current loads): use a transistor, MOSFET, or dedicated motor driver. Always add a 330Ω series resistor when driving LEDs directly.
Enabling Interfaces
I2C, SPI, UART, and camera interfaces are disabled by default. Enable them via sudo raspi-config → Interface Options. After enabling, reboot for changes to take effect. You can verify active I2C devices with i2cdetect -y 1.
Frequently Asked Questions
Is this Raspberry Pi GPIO reference free?
Yes, completely free. Look up any pin function without any account or payment.
Is my data private?
The tool runs entirely in your browser. No data is sent to any server.
What is the difference between BCM and physical pin numbering?
Physical numbering counts the pins from top-left (pin 1) to bottom-right (pin 40). BCM (Broadcom) numbering refers to the chip's GPIO port numbers — GPIO17 is pin 11 physically. Most Python libraries use BCM numbering with GPIO.setmode(GPIO.BCM).
How much current can Raspberry Pi GPIO pins handle?
Individual GPIO pins can safely source or sink 16mA. The total across all GPIO pins is limited to 50mA. For driving LEDs, always use a current-limiting resistor. For motors or higher-current loads, use a transistor or motor driver IC.
What voltage levels does Raspberry Pi GPIO use?
Raspberry Pi GPIO operates at 3.3V logic. The 5V pins on the header are power supply only — do NOT connect 5V signals directly to GPIO pins as this will damage the chip. Use a level shifter for 5V devices.
What are the I2C and SPI pins on the Pi?
I2C: SDA = GPIO2 (pin 3), SCL = GPIO3 (pin 5). SPI0: MOSI = GPIO10 (pin 19), MISO = GPIO9 (pin 21), SCLK = GPIO11 (pin 23), CE0 = GPIO8 (pin 24), CE1 = GPIO7 (pin 26). Enable I2C/SPI via raspi-config.
Can I use all 40 pins simultaneously?
No. Some pins are power/ground (8 pins total). Many GPIO pins share functions with I2C, SPI, and UART. If you use I2C, GPIO2 and GPIO3 are unavailable as general IO. The practical limit is about 26 usable GPIO pins, some with shared functionality.