DEV Community

Ikegbo Ogochukwu
Ikegbo Ogochukwu

Posted on

How to Identify Your Raspberry Pi's RAM Size: A Developer's Guide

Ever inherited a Raspberry Pi board, bought a used one, or forgot which model you grabbed from your electronics drawer? Since many Pi boards share the exact same physical layout, telling a 2GB, 4GB, or 8GB model apart just by looking at the green PCB can be tricky.

Here are the four best ways to identify your Raspberry Piโ€™s RAM size, ranging from quick terminal commands to inspecting the hardware components.

1. The Software Way: Terminal Commands (Fastest)

If your Raspberry Pi is powered on and you can access the terminal (via SSH or a desktop window), software commands provide the quickest answer.

Method A: Check /proc/meminfo

The Linux kernel keeps track of system memory in the /proc virtual filesystem. Run this command to see your total memory in kilobytes:

cat /proc/meminfo | grep MemTotal

  • What to look for:
  • ~940,000 kB = 1GB
    • ~1,900,000 kB = 2GB
    • ~3,800,000 kB = 4GB
    • ~7,800,000 kB = 8GB

Method B: Use the free Command

For a more human-readable format, use the free tool with the -h (human-readable) flag:

free -h

Look under the Total column in the Mem row. It will explicitly display 1.8Gi, 3.7Gi, or 7.6Gi.

2. The Configuration Way: Reading the Revision Code

Every Raspberry Pi has a specific hardware revision code embedded in its processor. This code encodes the model, revision number, manufacturer, and exact RAM size.
Run this command:

cat /proc/cpuinfo | grep Revision

You will get a 4-to-6-digit hexadecimal string (e.g., c03111 or d03114). You can match your code against the official Raspberry Pi documentation, or use this quick cheat sheet for the Raspberry Pi 4 Model B:

  • b03111 / b03112 / b03114 / b03115 = 2GB RAM
  • c03111 / c03112 / c03114 / c03115 = 4GB RAM
  • d03114 / d03115 = 8GB RAM

3. The Visual Way: Reading Silk-Screened PCB Markings

If your Pi is powered off, look directly at the top of the circuit board.

Raspberry Pi 5 and Recent Pi 4 Boards

On newer Raspberry Pi models, the developers made our lives incredibly easy. Look closely at the top-right corner of the board, right next to the headphone jack or micro-HDMI ports. You will see small, silver silk-screened text directly on the board indicating the memory size:

  • 2, 4, or 8 printed explicitly inside a small rectangular border.

Older Pi 4 Boards

Look closely at the board between the USB ports and the 40-pin GPIO header. The text Raspberry Pi 4 Model B is printed there. On some production runs, the RAM size is printed directly after the model name.

4. The Hardware Way: Decoding the RAM Chip FBGA Code

If your board doesn't have the size printed on the PCB, you can read the physical markings on the RAM chip itself. The RAM is the square, dark-metallic integrated circuit (IC) located right next to the main Broadcom CPU.
Raspberry Pi uses memory chips from manufacturers like Micron or Samsung. Micron chips use a 5-digit alphanumeric FBGA code instead of a traditional part number.
You can look up the code on Micron's website, or reference these common Raspberry Pi 4/5 markers:

  • D9WHV = 2GB LPDDR4
  • D9WHZ = 4GB LPDDR4
  • D9ZCL = 8GB LPDDR4X

Summary: Which Method Should You Use?

  • Pi is running headless? Use free -h.
  • Writing an automation script? Parse /proc/cpuinfo for the revision code.
  • Pi is sitting on your desk unplugged? Check the silver silk-screened number on the corner of the PCB.

How do you usually check your Pi hardware specs? Let me know in the comments below!

Top comments (0)