Raspberry pi is a powerful computer with amazing features of GPIO (General-purpose input-output) pins. There are many models available in the market. All models have almost similar Raspberry pi pinout. Here we will discuss all models of raspberry pi pinout in detail.


These are my affiliate link if you purchase anything from this link I will get a small commission. Your small purchase supports me to bring new things for you.

Raspberry pi 4 Pinout

Pi 4 is the latest bord we have in the market it is the most powerful board. It has 2 micro HDMI port, 4 USB port, and Ethernet port. Apart from this, it has a total of 40 GPIO pins.

Raspberry pi pinout
Raspberry pi 4 Pinout

Supply pins

Raspberry pi has 2 pins for 5v supply and 2 pin for 3.3v supply. It has total of 8 Ground pins.

OutputPin Number
5vPin no. 2 & Pin no. 4
3.3vPin no. 1 & Pin no. 17
GNDPin no. 6, 9, 14, 20, 25, 30, 34 and 39
supply pins

Input and Output Pins

In Raspberry pi 4 all pins can read as well as write from 0v to 3.3v. Every pin can use the internal pull-up and pull-down resistance. Also, GPIO2 and GPIO 3 has to fix pull up resistance. Rest all the pins can configure as pull up or pull down using the software.

A pull-up resistor connects unused input pins to the dc supply voltage, (Vcc) to keep the given input HIGH.
A pull-down resistor connects unused input pins to ground, (0V) to keep the given input LOW.

PWM Pins

All GPIO supports the PWM (Pulse-Width Modulation) signal using the software. Hardware PWM pins were available on pin no. 12, 13, 18, and, 19.

Communication Pins

The GPIO can be used for communication also. There are many pins support SPI, Serial communication, and I2C protocols.

SPI Protocol Pins

The Serial Peripheral Interface (SPI) is a synchronous serial communication interface specification used for short-distance communication, primarily in embedded systems. Raspberry pi has a total of 2 sets of pins for SPI.

Pin no. 9Pin no. 10Pin no. 11Pin no. 8Pin no. 7
Pin no. 19Pin no. 20Pin no. 21Pin no 18Pin no 17Pin no 16

I2C Protocol Pins

The inter-integrated circuit is a synchronous, multi-master, multi-slave, packet-switched, single-ended, serial computer protocol.

Pin no. 2Pin no. 3Pin no. 0Pin no. 1
I2C Protocol

Serial protocol Pins

The serial communication protocol is a communication protocol transmit one a bit at a time. This protocol uses widely in short-range communication. Raspberry pi 4 has GPIOs support serial communication.

Pin no. 14Pin no. 15
serial protocol

Raspberry Pi 3A+, B and all model Pinout

Pinout for raspberry pi 3 Model A+, Raspberry Pi 3 Model B and raspberry pi 3 has the same raspberry pi pinout as raspberry pi 4 have. They all have a total of 40 GPIOs having two 5v supply and two 3.3v supply.

raspberry pi pinout

Raspberry Pi Zero all model Pinout

Raspberry pi pinout
Raspberry pi zero

Zero is the mini version of normal raspberry pi like 4 or 3. Also, it has exactly the same pinout as the above mention. But you have to solder Male buck pins to use as others. It also has 40 pins with 2 5v output and two 3.3v output.

All the pins can be used as PWM output software. Every pin has inbuilt pull-up and pull-down resistance can be initialized using the software.

Raspberry Pi B pinout

Raspberry pi b is the first raspberry pi. It has a total of 26 pins. It has 2, 5v supply and 2, 3.3v supply and a total of 5 GND.

Supply pins

Raspberry pi B has one 3.3v supply one 5v supply and 5 GND.

5v 2 & 4
3.3v 1, 17
GND 6, 9, 14, 20, 25,
Supply pins

Input and Output Pins

Raspberry Pi B has total 17 GPIOs. All pins have internal pull up and pull down ability. Also all pins support pulse width modulation can be done by software.

Communications pin

SPI Protocol Pins

Raspberry pi B has 5 pins for for SPI communication.

CLK 23
SPI pins

UART Protocol Pins

Raspberry pi B has two pins which supports UART protocol.


I2C Protocol Pins

Raspberry pi B has 2 pin Supports I2C protocol. GPIO 2 & GPIO 3

Pin no. 3 Pin no. 5
I2C protocol pins

Raspberry pi B is outdated and not available in the market. Rest all model has exactly the same pinout.

Source:- Rapberry foundation.

Newsletter SignupLoving Our Content?

Subscribe to our weekly newsletter below and never miss any update that is most likely to blow your mind.