To check a Raspberry Pi's architecture, run uname -m in a terminal. A result of aarch64 means a 64-bit ARM kernel is running, while armv7l means a 32-bit ARM kernel. The kernel string alone doesn't tell the whole story, though, because the capable hardware inside most modern Pi boards often runs a 32-bit operating system by default. A complete answer combines three facts: which CPU family and revision the board carries, whether the installed OS userland is 32-bit or 64-bit, and which kernel is currently booted. Each fact comes from a different command, and mixing them up is the most common reason people misread their own Pi.
This guide walks through the commands in a sensible order, explains what each output actually proves, covers the traps around ARM naming and the Pi 4's switchable memory map, and ends with a reproducible way to check your work.
What "architecture" means on a Raspberry Pi
The word gets used for at least four different things, and the check you need depends on which one you care about:
Board model. Which Pi you have (Pi 3, Pi 4, Pi 5, Zero 2 W, and so on). This determines the CPU cores, the maximum RAM, and the instruction set the silicon supports. CPU architecture. The processor family and ARM revision, such as ARMv7 or ARMv8-A. ARMv8-A chips can execute 32-bit ARMv7 code and 64-bit AArch64 code. Operating system userland. Whether the installed distribution ships 32-bit or 64-bit binaries and libraries. Raspberry Pi OS historically defaulted to 32-bit even on 64-bit-capable boards. Running kernel. The kernel the system booted right now, which can be 32-bit (armv7l) or 64-bit (aarch64) and doesn't always match the userland.
A Pi 4 running the classic 32-bit Raspberry Pi OS reports armv7l from uname -m even though its Cortex-A72 cores are ARMv8-A. That mismatch is normal, not a fault. If your goal is to grab the right installer, compile a program, or check whether a container image will run, you need the userland and kernel answer, not the marketing name of the chip.
Prerequisites and where to run the commands
You need terminal access to the Pi, either directly with a keyboard and monitor, over SSH, or through the Raspberry Pi Connect remote shell. Any user account can run the commands below; none of them require sudo. They're read-only queries against files in /proc and /sys, so nothing changes and there's nothing to undo.
Open a terminal. On Raspberry Pi OS with a desktop, that's the Terminal icon in the taskbar or Ctrl+Alt+T if you've set that shortcut. On a headless install, SSH in with your usual credentials. From here, copy commands one at a time so you can read each result.
One caution before you start: several online guides paste in a command that fetches a script from the internet to "detect your Pi." You don't need that. Everything here uses tools preinstalled on Raspberry Pi OS and most other Debian-based distributions.
Step 1: Identify the board model
Start with the hardware, because model determines what architectures are even possible.
You'll get something like Raspberry Pi 4 Model B Rev 1.4 followed by a null character that may print as a stray symbol. The model name is the useful part.
On Raspberry Pi OS you can also use the dedicated tool:
It prints a labeled GPIO diagram with the board type, revision code, and memory size in the header. If pinout isn't installed, cat /proc/cpuinfo shows a Revision line whose hex code maps to a specific board and RAM configuration; Raspberry Pi documents the mapping in its own revision-code table.
What this tells you: whether the board is 64-bit capable. Every Pi from the Pi 3 onward, plus the Zero 2 W and the Pi 400 and Pi 500, has a 64-bit-capable ARMv8 core. The original Pi 1, Pi Zero, and Pi Zero W are 32-bit only (ARMv6 for the Pi 1 and Zero, ARMv7 for later revisions of some models). The Pi 2 straddles generations: the early revision used a 32-bit-only Cortex-A7, while the v1.2 revision moved to the 64-bit-capable Cortex-A53.
Check: the model string should match the silkscreen on the board and the RAM you believe you bought. If it doesn't, you're either on a different machine than you think or looking at a clone board with a modified device tree.
Step 2: Read the CPU architecture and core details
Two files cover this, and they answer slightly different questions.
returns the machine hardware name as the kernel sees it. On a 32-bit kernel you'll see armv7l (or armv6l on a Pi 1 or Zero). On a 64-bit kernel you'll see aarch64.
gives the fuller picture: Architecture: (again armv7l or aarch64), CPU op-mode(s): such as 32-bit, 64-bit, the model name like Cortex-A72, the number of CPUs, and the byte order. If lscpu is missing, cat /proc/cpuinfo shows the processor line, the Features flags, and the hardware line, which on 64-bit kernels commonly reads BCM2835 even on a Pi 4 or Pi 5 because it reflects the legacy SoC identification rather than the actual chip.
What this tells you: the mode the CPU is operating in right now. CPU op-mode(s): 32-bit, 64-bit on a Pi 4 confirms the silicon can do both; the Architecture: line tells you which one is active.
Trap: don't infer the board's capability from uname -m. A Pi 5 running a 32-bit OS reports armv7l and looks identical to a Pi 3 in that one line. Step 1 is what separates them.
Step 3: Determine whether the OS userland is 32-bit or 64-bit
This is the step most guides skip, and it's usually the answer people actually need. The userland is the collection of binaries and shared libraries your programs link against. You can check it without root using the file utility on a core system binary:
A 64-bit userland reports ELF 64-bit LSB pie executable, ARM aarch64. A 32-bit userland reports ELF 32-bit LSB pie executable, ARM, EABI5. Running file /usr/bin/python3 gives the same distinction and is useful if /bin/bash has been replaced on your system.
The package manager agrees:
prints arm64 on a 64-bit Raspberry Pi OS install and armhf on a 32-bit one. If you're running something other than Debian-based Raspberry Pi OS, check the equivalent: rpm -q --qf '%{ARCH}\n' rpm on RPM systems, or just read the file output.
What this tells you: which precompiled binaries will run natively. A 64-bit kernel can execute 32-bit userland binaries if the compatibility libraries are installed, and a 32-bit kernel cannot execute 64-bit binaries at all. That asymmetry matters when you're deciding whether to reflash.
Check: uname -m and dpkg --print-architecture often disagree on a stock Pi 4, and that's expected. If you want them to agree, you need to install the 64-bit image rather than patch the running system.
Step 4: Confirm with the kernel and the OS release
For a final cross-check, two more commands.
shows the full kernel release, build date, and the architecture suffix: ... aarch64 GNU/Linux or ... armv7l GNU/Linux. The kernel release string includes the version, which is useful if you're matching against a known-good configuration.
prints the distribution name, version, and VERSION_CODENAME (for example bookworm). Raspberry Pi OS names its 64-bit images explicitly, so the release file plus dpkg --print-architecture settles the question of which image is installed.
On a Pi 4 or Pi 5, there's one more wrinkle worth knowing. Those boards can run with a 32-bit or 64-bit kernel regardless of userland, controlled by arm_64bit in /boot/firmware/config.txt (older images used /boot/config.txt). Reading that file shows the configured setting, though the running state is what uname -m reports. You don't need to change it to answer the question; just know that a 64-bit userland with a 32-bit kernel is a possible, if unusual, combination.
Reading the results: a quick decision table
Here's how the common outputs combine on real hardware. The rows are illustrative of configurations you'll actually encounter, not a survey.
| Board | uname -m | dpkg --print-architecture | file /bin/bash | Interpretation |
|---|---|---|---|---|
| Pi 3B | armv7l | armhf | ELF 32-bit | 32-bit OS on 64-bit-capable hardware |
| Pi 4B, stock 32-bit OS | armv7l | armhf | ELF 32-bit | Classic mismatch; board supports 64-bit |
| Pi 4B, 64-bit OS | aarch64 | arm64 | ELF 64-bit | Fully 64-bit |
| Pi 5, 64-bit OS | aarch64 | arm64 | ELF 64-bit | Normal modern setup |
| Pi Zero W | armv6l | armhf | ELF 32-bit | 32-bit-only hardware |
| Pi Zero 2 W, 64-bit OS | aarch64 | arm64 | ELF 64-bit | 64-bit-capable board |
The table makes the core rule visible: match the userland to the kernel when you're compiling or containerizing, and match both to the board when you're choosing an image.
Edge cases and failure modes
The Pi 4's memory-map quirk. The Pi 4's peripherals are mapped high in the address space, which is why early 64-bit kernels couldn't boot on it. Modern Raspberry Pi OS handles this transparently, but if you're running an old third-party image from 2019 or early 2020, a 64-bit kernel may fail or behave oddly. The check is the same: boot it, run uname -m. If you're troubleshooting a board that won't boot a 64-bit image, this history is a plausible cause.
Clone boards. Some third-party Pi-compatible boards modify /proc/device-tree/model or report a generic string. If the model line looks wrong but the commands otherwise work, trust lscpu and uname -m over the model string, and cross-check the revision code against the manufacturer's documentation.
Containers and chroots. Inside a Docker container or a chroot, uname -m reports the host kernel's architecture, while file on a binary inside the container reports the container image's architecture. Neither is wrong; they answer different questions. If you're checking whether an image will run on your Pi, the image's architecture is what matters.
Cross-compilation targets. Build scripts often need the target triple, not just the word "64-bit." For Raspberry Pi OS 64-bit, that's typically aarch64-linux-gnu; for 32-bit, arm-linux-gnueabihf. You can confirm the guest-side answer with gcc -dumpmachine if a compiler is installed, which prints exactly the triple the toolchain was built for.
Missing commands. On minimal images, lscpu and file might not be present. The fallbacks are cat /proc/cpuinfo for CPU details and reading the ELF header manually with od -An -t x1 -N 20 /bin/bash and checking byte 4 (01 for 32-bit, 02 for 64-bit), though that's rarely worth the trouble. Installing util-linux and file with sudo apt install util-linux file restores the easy path.
When to stop and get help
These commands are safe, but a few situations mean the answer needs a human. If your Pi won't boot at all, the architecture question is moot until you recover it; a fresh Raspberry Pi Imager flash to a known-good card is the standard first move. If you're planning to migrate a running system from 32-bit to 64-bit Raspberry Pi OS, that's a reinstall, not a toggle, and you should back up data and verify your services' package availability before starting. And if a third-party board reports contradictory model and revision information, the vendor's documentation is the only reliable source.
A reproducible check you can run in one pass
Once you understand the pieces, a single script answers everything. Paste this into a file, make it executable, and run it whenever you need the full picture:
Expected output on a Pi 5 with 64-bit Raspberry Pi OS looks roughly like this:
The kernel version string will differ depending on when you last updated; that's fine. The check that matters is consistency: on a normal 64-bit install, aarch64, arm64, and ELF 64-bit should all appear together. If uname -m says aarch64 but dpkg says armhf, you have a 64-bit kernel with 32-bit userland, which works but limits you to 32-bit packages. If uname -m says armv7l on a Pi 4 or Pi 5, you're almost certainly running the 32-bit image and can reflash to the 64-bit one if you need 64-bit software.
Record the output somewhere if you're provisioning several boards. A printed label or a note in your inventory saves the next person from re-running the same four commands, and it makes version drift across a fleet obvious the first time someone upgrades one board and not the others.