Ever wondered what model of Raspberry Pi you have? Here’s how to find out.

A step-by-step guide on how to check the model of your Raspberry Pi using the command line and Python code. …


Updated August 22, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


A step-by-step guide on how to check the model of your Raspberry Pi using the command line and Python code.

There are several models of Raspberry Pi available in the market, each with its own specifications and capabilities. Knowing which model you have can be useful for troubleshooting, choosing compatible accessories or learning about the hardware limitations of your device. In this article, we’ll show you two methods to check your Raspberry Pi model - one using the command line and another using Python code.

  1. Check Your Raspberry Pi Model Using The Command Line:

You can use the cat command in the terminal to find out your Raspberry Pi’s model number. Open a terminal window on your Raspberry Pi device by either connecting a keyboard and monitor or using SSH (if you have enabled it). Then, enter the following command:

cat /proc/device-tree/model

This will output the model name of your Raspberry Pi. For example:

Raspberry Pi 4 Model B Rev 1.2

Or:

Raspberry Pi 3 Model B Plus Rev 1.3
  1. Check Your Raspberry Pi Model Using Python Code:

You can also use a simple Python script to determine your Raspberry Pi’s model number. Open a text editor and create a new file called model.py. Add the following code to the file:

import platform

print(platform.machine())

Save the file and run it using Python 3:

python3 model.py

The output will be your Raspberry Pi’s model number, such as armv7l for Raspberry Pi 2/3 or aarch64 for the newer Raspberry Pi 4 models.

Remember that these are just generic machine names and don’t provide exact model information. To get the full name of your device, use the command line method described above.

In conclusion, knowing your Raspberry Pi’s model can be helpful when troubleshooting or choosing compatible hardware components. You can use either the command line or Python code to find out which model you have and make informed decisions based on that information.