How to Read the Raspberry Pi GPIO Pinout Diagram on pinout.xyz
Updated
pinout.xyz is an interactive reference for the Raspberry Pi 40-pin GPIO header and for hundreds of add-on boards, HATs, and pHATs. To read it correctly, hold your Pi so the GPIO header is on the right and the HDMI port(s) are on the left, then read each pin's two labels: the physical pin number (its position in the 40-pin row) and the GPIO number (the name you use in code). The site's legend tells you which pins are power, ground, or a specific interface such as I2C, SPI, UART, or PCM.
Physical pin numbers vs. GPIO numbers
Every pin on the header has two identities, and mixing them up is the most common source of wiring mistakes.
- Physical pin number — the pin's position in the 40-pin connector, counted 1–40. Pin 1 is at one end of the header; pin 2 is directly across from it on the other row.
- GPIO number — the Broadcom (BCM) name of the signal that pin carries, such as GPIO 17 or GPIO 4. This is what you reference in software.
The two numbering schemes do not line up. For example, physical pin 11 is GPIO 17, and physical pin 13 is GPIO 27. A board or tutorial that says "connect to GPIO 17" means the BCM number, not pin 17.
| Physical pin | GPIO / function |
|---|---|
| 1 | 3v3 Power |
| 3 | GPIO 2 (I2C1 SDA) |
| 5 | GPIO 3 (I2C1 SCL) |
| 7 | GPIO 4 (GPCLK0) |
| 9 | Ground |
| 11 | GPIO 17 |
| 13 | GPIO 27 |
Identifying power, ground, and signal pins
The legend on pinout.xyz color-codes each pin so you can classify it at a glance before wiring anything:
- 3.3v and 5v power — supply pins. The header provides 3v3 and 5v rails; feeding a 3.3v-only device from 5v can damage it.
- Ground — the return path. Several pins are ground, spread across the header.
- GPIO — general-purpose input/output, usable as digital in or out.
- Interface pins — labeled by protocol: I2C, SPI, UART, PCM, PWM, GPCLK, DPI, SDIO, JTAG, and 1-WIRE.
Because a single physical pin can carry more than one function (for instance, GPIO 2 is both a plain GPIO and the I2C1 SDA line), the diagram shows the alternate functions alongside the GPIO number. That is how you find, say, the SPI0 MOSI pin (GPIO 10, physical pin 19) without counting.
Orienting the diagram to match your board
The site states the reference orientation directly: orient your Pi with the GPIO on the right and the HDMI port(s) on the left. In that position, pin 1 is at the top-left of the header as drawn, and the numbering snakes down one row and back up the other.
If your board is physically positioned differently, you do not have to mentally rotate it:
- Mirror view — shows the pinout as seen from the underside of the board, useful when you are soldering or probing from the back.
- Rotate 180° — flips the diagram so it matches a board held the other way.
Both views keep the same pin identities; only the drawing changes, so the physical-to-GPIO mapping stays valid.
Beyond the 40-pin header
pinout.xyz is not limited to the standard header. The same site hosts:
- Pico family pinouts — Raspberry Pi Pico, Pico W, Pico 2, and Pico 2 W.
- Chip planners — RP2350A (QFN-60) and RP2350B (QFN-80).
- Experimental pinouts — a minimal 40-pin layout, Espressif ESP32 C5 and C3 DevKitC, and the PJRC Teensy 4.0.
- A board explorer — pinouts for hundreds of HATs and pHATs, so you can check how an add-on board maps onto the header before you stack it.
Common pitfalls
- Reading pin 1 from the wrong end. Confirm orientation against the HDMI port before trusting any count.
- Confusing BCM and physical numbers in code. Libraries differ; check which scheme your code expects.
- Assuming a pin does only one thing. Alternate functions share pins, so two peripherals may conflict.
- Ignoring voltage. The header mixes 5v and 3.3v; match the device to the correct rail.