Raspberry Pi GPIO Bus Pinouts

The tables on this page show the pin-outs for the GPIO header on the Raspberry Pi connector. This is the double row of closely spaced pins on the top-side of the board, in the upper left corner if the board is held with the USB connector on the right-hand edge of the board.

With the board held in this orientation, the top row of pins are numbered with even numbers from two to forty, left to right. This is the row of pins closest to the top edge of the board.

The lower row are numbered with odd numbers from 1 to thirty-nine.

The earlier versions of the Raspberry Pi had a GPIO bus with only 26 pins. The later 40 pin bus is directly compatible with this earlier version, and the pins below 27 are the same. However, do not try to connect a 256 way ribbon cable to a 40 pin Raspberry Pi, or you will bend pins 27 and 28, possibly irretrievably.

Don’t attempt to connect anything to these pins unless you are sure you know what you are doing. There are plenty of projects and notes about interfacing to the GPIO bus on the Raspberry Pi Foundation web pages and elsewhere.

I cannot be held responsible for any damage caused to a Raspberry Pi by incorrect or imprudent use of the GPIO pins.

Also be aware that the Raspberry Pi hardware is static sensitive. Do not be tempted to touch the GPIO pins casually, even if the box you have used has a cut-out to allow for external connection of a header cable or adaptor.

To connect a header plug, or any other device into the GPIO header; first shutdown any operating system that is running on the Pi. Disconnect all the cables and make sure your body and your hands are at the same potential as the board. I do this by only handling the board with my forearms planted firmly on the table surface. Offer any plug to the GPIO pins very gently and don’t force it on. It is very easy to bend the pins on the header and a few moments taken to do this very carefully could avoid permanent damage to your Raspi.

It’s cheaper and less distressing to destroy the other end of a ribbon cable than it is to break your Raspberry Pi.

If you want to connect something to the GPIO pins other than a full 26 or 40 way header, like a 2-wire connector for the I2C serial line, confirm you have connected to the correct pins by counting along the line of unconnected pins with a fingernail, gently. Do this several times. The old carpentry maxim of ‘measure twice, cut once’ is a good one.

Under no circumstances attempt to solder direct to the GPIO pins, even if you get someone who can see to do this for you. The stray currents present on the tip of a soldering iron can be death to the delicate insides of the SoC, and nasty solder on those nice gold pins will stop you connecting a header plug at a later time.

P1 Header Pinout, top row

Pin Number Pin Name Rev1 Pin Name Rev2 Hardware Notes Alt 0 Function Other Alternative Functions
P1-02 5v0 5v0 Supply through input poly fuse    
P1-04 5v0 5v0 Supply through input poly fuse    
P1-06 GND GND      
P1-08 GPIO14 GPIO14 Boot to Alt 0 -> UART0_TXD ALT5 = UART1_TXD
P1-10 GPIO15 GPIO15 Boot to Alt 0 -> UART0_RXD ALT5 = UART1_RXD
P1-14 GND GND      
P1-16 GPIO23 GPIO23  v   ALT3 = SD1_CMD ALT4 = ARM_RTCK
P1-18 GPIO24 GPIO24     ALT3 = SD1_DAT0 ALT4 = ARM_TDO
P1-20 GND GND      
P1-22 GPIO25 GPIO25     ALT3 = SD1_DAT1 ALT4 = ARM_TCK
P1-24 GPIO08 GPIO08   SPI0_CE0_N  
P1-26 GPIO07 GPIO07   SPI0_CE1_N  
P1-28 ID_SC ID_SC ?    
P1-30 GND GND      
P1-32 GPIO12 GPIO12      
P1-34 GND GND      
P1-36 GPIO16 GPIO16      
P1-38 GPIO20 GPIO20      
P1-40 GPIO21 GPIO21      

P1 Header Pinout, bottom row

Pin Number Pin Name Rev1 Pin Name Rev2 Hardware Notes Alt 0 Function Other Alternative Functions
P1-01 3v3 3v3 50 mA max (01 & 17)    
P1-03 GPIO 0   PIO 2 1K8 pull up resistor I2C0_SDA / I2C1_SDA
P1-05 GPIO 1 GPIO 3 1K8 pull up resistor I2C0_SCL / I2C1_SCL  
P1-09 GND GND      
P1-13 GPIO21 GPIO27   PCM_DOUT / reserved ALT4 = SPI1_SCLK ALT5 = GPCLK1 / ALT3 = SD1_DAT3 ALT4 = ARM_TMS
P1-15 GPIO22 GPIO22   ALT3 = SD1_CLK ALT4 = ARM_TRST  
P1-17 3v3 3v3 50 mA max (01 & 17)    
P1-19 GPIO10 GPIO10   SPI0_MOSI  
P1-23 GPIO11 GPIO11   SPI0_SCLK  
P1-25 GND GND      
P1-27 ID_SD ID_SD ?   -
P1-29 GPIO5 GPIO5 - - -
P1-31 GPIO6 GPIO6 - - -
P1-33 GPIO13 GPIO13 - - -
P1-35 GPIO19 GPIO19 - - -
P1-37 GPIO26 GPIO26 - - -
P1-39 GND GND - - -


The maximum current capable of being sourced from P1 pins 1 and 17 is 50mA in total. That is the current drawn from both pins, not 50mA each. These are the 3v3 pins.

There are currently no split revisions for the Model B+. I have simply put the same thing in both columns.

At the time of writing I don’t know what the alternative functions for the additional GPIO pins are, if any.

I do not believe there are any split revisions for versions 2 and above of the Raspberry Pi.

Thanks to John W of the Surrey Linux user group for helping me by looking at the published diagram.