How to Find Raspberry Pi HAT and pHAT Pinouts on pinout.xyz
Updated
pinout.xyz includes pinouts for hundreds of Raspberry Pi add-on boards, HATs, and pHATs, and you reach them through the site's board explorer rather than the main 40-pin diagram. Use this route when you have a specific expansion board and need to know which physical pins it uses before wiring or stacking it. The main page covers the standard 40-pin header; the HAT/pHAT section covers the boards that plug into it.
What the main page gives you
The default view is an interactive reference for the Raspberry Pi 40-pin GPIO header. It labels each physical pin with its function, including:
- Power pins: 3v3 (physical pins 1, 17) and 5v (physical pins 2, 4)
- Ground pins: physical pins 6, 9, 14, 20, 25, 30, 34, 39
- Interface groups: I2C, SPI, UART, PCM, PWM, GPCLK, DPI, SDIO, JTAG, and 1-WIRE
The legend explains each colour and abbreviation, and the page notes the orientation convention: hold the Pi with the GPIO header on the right and the HDMI port(s) on the left. There are also controls to mirror the pinout for the underside of the board or rotate it 180 degrees.
This is the reference for the header itself. It does not tell you what a particular HAT does with those pins.
Finding a HAT or pHAT pinout
The main page links to a board explorer with the prompt "Click here to browse pinouts for HATs & pHATs" and a section titled "Explore HATs & pHATs." That explorer is where the add-on board pinouts live.
A practical sequence:
- Open pinout.xyz and locate the HATs & pHATs link or the board explorer section.
- Browse or search the board list for your specific add-on board.
- Open that board's page to see its pin usage mapped onto the 40-pin header.
- Compare the board's claimed pins against the interfaces you plan to use, so two boards don't collide on the same I2C, SPI, or UART pins.
The expected result is a board-specific view showing which physical pins the HAT or pHAT occupies and which functions it exposes.
Why this matters before you connect anything
Two HATs can each work perfectly alone and still conflict when stacked, because both may claim the same I2C address lines or SPI chip-select pins. Checking each board's pinout first turns that from a debugging session into a planning step.
The same applies to wiring a HAT alongside your own jumpers: if the board uses GPIO 14/15 for UART, those pins aren't free for something else.
Other pinouts on the site
Beyond the 40-pin header and the HAT/pHAT explorer, pinout.xyz also publishes pinouts for:
- Raspberry Pi Pico, Pico W, Pico 2, and Pico 2 W
- RP2350A (QFN-60) and RP2350B (QFN-80) chip planners
- Experimental pinouts including a minimal 40-pin Raspberry Pi pinout, Espressif ESP32 C5 and C3 DevKitC, and the PJRC Teensy 4.0
If your board isn't a HAT or pHAT but one of these, use the matching page instead of the main header diagram.
Common snags
- Reading the wrong diagram. The 40-pin header view and a HAT page look similar; confirm you're on the board-specific page before trusting a pin number.
- Physical vs BCM numbering. The header diagram pairs physical pin positions with GPIO/BCM names (for example, physical pin 3 is GPIO 2, I2C1 SDA). Software often uses the BCM name, so translate before writing code.
- Orientation. The default view assumes GPIO on the right, HDMI on the left. If you're looking at the underside, use the mirror or rotate controls rather than counting pins backwards in your head.