If you want to squeeze a bit more performance out of your Raspberry Pi, you can raise the processor frequency (overclock) in the config.txt file. This guide explains which parameters the Raspberry Pi 4 and 5 use, their stock frequencies according to the official documentation and how to check that the system stays stable at a reasonable temperature.
First, a warning: overclocking forces components to work above what the manufacturer guarantees, generates more heat and can shorten their life. The sensible approach is a gentle overclock, raising it gradually and always watching temperature and stability. And you need cooling, no exceptions: heatsinks at minimum and, better, a fan.
Requirements
- Raspberry Pi 4, Pi 400 or Raspberry Pi 5 (also their Compute Module 4 and 5).
- Active cooling. For the Raspberry Pi 5, the official documentation recommends the Active Cooler precisely to anyone who wants to overclock; for the Pi 4 there is the official case fan.
- A quality power supply: the official 5 V/3 A for the Pi 4 and 5 V/5 A (27 W) for the Pi 5. If voltage drops, the firmware disables the overclock.
- Updated Raspberry Pi OS (see how in update Raspberry Pi OS and firmware).
Stock frequencies
Default values according to the official config.txt documentation:
| Model | CPU (arm_freq) | GPU core (core_freq) |
|---|---|---|
| Pi 4B (up to rev. 1.3) and CM4 | 1500 MHz | 500 MHz |
| Pi 4B rev. 1.4 | 1500 MHz, or 1800 MHz with arm_boost=1 | 500 MHz |
| Pi 400 | 1800 MHz | 500 MHz |
| Pi 5 / 500 | 2400 MHz | 910 MHz |

To find out exactly which board you have:
cat /proc/device-tree/model
If you have a rev 1.4 Pi 4B running at 1500 MHz, the first “official” step is to add arm_boost=1, which raises the frequency to the board’s maximum supported without touching voltage by hand.
The parameters that matter

arm_freq: CPU frequency in MHz.gpu_freq: adjusts the graphics core, h264, isp, v3d and hevc frequencies together.over_voltage: upper CPU/GPU voltage limit, in 0.025 V steps. Above 6 is only allowed together withforce_turbo=1.over_voltage_delta(Pi 4 and Pi 5): adds an offset in microvolts to the voltage the DVFS algorithm calculates. For example,25000adds 0.025 V. On the Pi 5 it is the recommended way to give more voltage, because idle power saving is kept.force_turbo: forces turbo frequencies even when the CPU is idle. Avoid it.temp_limit: temperature at which the firmware returns to stock frequencies and voltages. The default is 85 °C and it cannot be raised higher.
Warranty: the documentation warns that combining force_turbo=1 with any over_voltage_* greater than 0 sets a permanent bit in the chip that records the overclock. Do not use force_turbo and you will not have that problem.
Step 1: measure the starting point
Install sysbench:
sudo apt install sysbench
Create a script that measures temperature between load tests:
nano testoverclock.sh
With this content:
#!/bin/bash
clear
for f in {1..7}
do
vcgencmd measure_temp
sysbench cpu --cpu-max-prime=20000 --threads=4 run > /dev/null 2>&1
done
vcgencmd measure_temp
Make it executable and run it:
chmod +x testoverclock.sh
./testoverclock.sh
Note the maximum temperature reached at stock frequency. If it already approaches 80 °C, improve cooling before going on: the Raspberry itself starts lowering the CPU frequency between 80 and 85 °C.
Step 2: edit config.txt
On Raspberry Pi OS Bookworm and Trixie the file is at /boot/firmware/config.txt (on old systems it was /boot/config.txt):
sudo nano /boot/firmware/config.txt
Add the changes at the end, inside a section for your model. That way, if you move the card to another Raspberry, they will not apply. As an example, a first 100 MHz step over the stock frequencies in the table (not a guaranteed value; every chip differs):
[pi4]
arm_freq=1900
[pi5]
arm_freq=2500
[all]
The [pi4] section applies to the Pi 4B, 400 and CM4/CM4S; [pi5] to the Pi 5, 500 and CM5. [all] closes the filters so whatever is below applies to all.
Save with Ctrl+O, exit with Ctrl+X and reboot:
sudo reboot
Step 3: raise it gradually
Repeat the cycle: raise arm_freq about 100 MHz, reboot, run the script and use the Raspberry for a while with your usual programs. If you get freezes, errors or it does not boot, you have two options:
- Go back to the last stable frequency (the wisest).
- Add a bit more voltage:
over_voltage_deltain small increments on the Pi 5, orover_voltageone at a time on the Pi 4. More voltage means more temperature, so measure again.

Check that it works
Actual CPU frequency (in hertz), temperature and throttling state:
vcgencmd measure_clock arm
vcgencmd measure_temp
vcgencmd get_throttled
get_throttled should return throttled=0x0. If not, read the bits:
| Bit | Value | Meaning |
|---|---|---|
| 0 | 0x1 | Under-voltage now |
| 1 | 0x2 | CPU frequency capped now |
| 2 | 0x4 | Throttling active now |
| 3 | 0x8 | Soft temperature limit active |
| 16 | 0x10000 | Under-voltage has occurred |
| 17 | 0x20000 | Frequency capping has occurred |
| 18 | 0x40000 | Throttling has occurred |
| 19 | 0x80000 | Soft temperature limit reached |
On the Pi 5 you can also see the input voltage with vcgencmd pmic_read_adc EXT5V_V.
Common problems
The Raspberry does not boot after the change. Take out the card, open it on your computer (the boot partition is FAT32) and delete or comment out with # the lines you added to config.txt.
get_throttled shows 0x50000 or 0x50005. There is under-voltage: the supply cannot deliver enough current or the cable is bad. With under-voltage the overclock turns itself off, so fix power first.
Frequency does not go above stock. Check your lines are in the right section ([pi4] or [pi5]) and not under another filter. Also remember that with little load the CPU lowers its frequency to save power: measure with the script running.
Temperatures above 80 °C. You are losing performance to throttling, so the overclock is pointless. Improve cooling or lower the frequency. Standing the Raspberry upright also helps a bit with heat.
Random errors in programs or card corruption. Typical signs of an unstable overclock. Go back to stock and raise more slowly.
Frequently asked questions
Is it worth it? It depends on use. For tasks with headroom you will barely notice; it shows most on sustained CPU loads, provided cooling prevents throttling.
How do I undo the overclock? Delete or comment the lines you added in config.txt and reboot. The Raspberry returns to stock frequencies.
Related
- Which Raspberry Pi to buy: Pi 5, Pi 4 or Zero 2 W
- Update Raspberry Pi OS and firmware
- Enable SSH on a Raspberry Pi without monitor or keyboard



