Yes, you can overclock a Raspberry Pi safely: you add a few lines to the config.txt boot file, reboot, then verify stability with a stress test and temperature monitoring. Overclocking makes the CPU (and optionally the GPU and RAM) run faster than the factory setting, which helps with emulation, video playback, and light server workloads. Modern Raspberry Pi devices run at their rated speed by default, but the firmware throttles when the chip gets hot, so good cooling is the real prerequisite. You change nothing permanent — removing the lines and rebooting restores stock speed. This guide assumes a Raspberry Pi running the official Raspberry Pi OS and applies to Raspberry Pi 4 and other models, though supported values differ per model.

What You'll Need

  • A Raspberry Pi running an up-to-date Raspberry Pi OS
  • A proper power supply — use the official one for your model; an underpowered supply causes instability that looks exactly like a bad overclock
  • Cooling: heatsinks at minimum, ideally a case with a fan
  • A keyboard and monitor, or SSH access from another computer
  • A microSD card with a current backup of anything important, since an unstable overclock can corrupt it

Step-by-Step

  1. Update the system first. Open a terminal and run sudo apt update && sudo apt full-upgrade, then reboot. Firmware and kernel updates affect clocking behavior, so start from current software.
  2. Check your baseline. Run vcgencmd measure_temp and vcgencmd measure_clock arm in a terminal. Note the idle temperature (typically 40–55 °C depending on model and ambient temperature) so you can compare after overclocking.
  3. Open the boot configuration file. Run sudo nano /boot/config.txt (on some setups the path is /boot/firmware/config.txt). This file is read at every boot. Exact option names and maximum supported values vary by model, so stick to the values documented on the official Raspberry Pi documentation for your specific board.
  4. Add the overclock settings. Under the existing [all] section (or add one), insert the appropriate line for your model. For example, a Raspberry Pi 4 uses arm_freq=2000 (up from the stock 1800) to raise the CPU ceiling, and optionally gpu_freq=750 for the GPU. For a Raspberry Pi 3, common safe additions are arm_freq=1350, core_freq=500, sdram_freq=500, and over_voltage=4 (over_voltage is only needed when the board will not hold the higher clock at stock voltage). Start at the low end of documented values rather than the maximum.
  5. Save and reboot. Press Ctrl+O, Enter, then Ctrl+X in nano, then run sudo reboot.
  6. Verify the clock took effect. After rebooting, run vcgencmd measure_clock arm again while the Pi is under a small load. If the reported frequency has not changed, re-check the config file for typos and make sure the lines are in the correct section — they must not sit after a section header for a different board revision.
  7. Install and run a stress test. Install stress-ng with sudo apt install stress-ng, then run it on all cores for a sustained period: stress-ng --cpu 4 --cpu-method matrixprod --metrics-bye --timeout 15m (use your model's core count). While it runs, watch temperature in a second terminal with watch -n 2 vcgencmd measure_temp, or use htop to confirm all cores are at 100%.
  8. Check for throttling. Run vcgencmd get_throttled during and after the test. A result of throttled=0x0 means no throttling occurred. Non-zero flags indicate under-voltage or thermal throttling — fix cooling or the power supply before pushing further. A Pi 4 begins to throttle at 80 °C and forces a hard limit at 85 °C.
  9. Run a longer real-world test. If the 15-minute run passes with no errors and temperatures stay below the throttle point, repeat for an hour or run your actual workload (emulator, media playback, compile jobs). Freezes, random reboots, or filesystem errors mean the overclock is unstable — drop the frequency a step and test again.

Menu and file labels can differ slightly between OS versions and models; the config.txt approach above is the standard method on Raspberry Pi OS.

Common Mistakes

  • Overclocking with poor or no cooling, then mistaking thermal throttling for a failed overclock — the Pi slows itself down before it overheats, so you gain nothing.
  • Using a weak phone charger. Undervoltage triggers the throttling flags and causes crashes that have nothing to do with your clock settings.
  • Jumping straight to the maximum values other people post online. Every chip is different; some need lower clocks or added voltage, others will not overclock at all.
  • Skipping the backup. An unstable overclock under load can corrupt the microSD card, and losing an unbacked-up project is the most common real cost of this hobby.
  • Editing the wrong section of config.txt, so the settings apply to no board or the wrong one.
  • Stress testing for only a minute. Instability often appears after several minutes once heat builds up.

Tips

  • Improve cooling before raising clocks — a fan and heatsinks often deliver more real-world speed than the overclock itself, because they prevent throttling.
  • Change one value at a time so you know which setting caused any instability.
  • If you see the lightning-bolt undervoltage icon on screen, stop and fix the power supply first.
  • Log temperatures during the test, e.g. a loop writing vcgencmd measure_temp output to a file, so you can review the peak afterward.
  • An unstable Pi that will not boot can usually be fixed by putting the microSD card in another computer and editing config.txt there — just delete or lower the overclock lines.

Troubleshooting

  • Pi will not boot after the change: mount the microSD card on another computer, open config.txt, and remove or reduce the new lines. This is why overclocking via config.txt is low risk — it is always reversible.
  • Frequency did not change: check for typos, confirm the lines are under [all] or the correct model section, and reboot fully.
  • vcgencmd get_throttled shows non-zero flags: 0x1 means undervoltage now (replace the power supply or cable); 0x4 or 0x8 mean thermal throttling (improve cooling, lower clocks). Higher bits just record that it happened earlier since boot.
  • Freezes or reboots under load: lower arm_freq by one step, or if you are near the documented ceiling and still unstable, add a modest over_voltage as documented for your model, then retest.
  • Filesystem errors or corruption: run sudo fsck if prompted at boot, restore from your backup if needed, and run a lighter stable clock going forward.

Frequently Asked Questions

Can overclocking damage a Raspberry Pi?

Almost never. The firmware enforces hard thermal and voltage limits, and the board throttles or shuts down before damage occurs. The realistic risks are crashes and a corrupted microSD card, not fried hardware.

Does overclocking void the warranty?

No. The overclock settings in config.txt are an official, supported feature, and Raspberry Pi has explicitly stated that using them does not void the warranty.

How hot is too hot?

Keep sustained temperatures below about 80 °C, where the Pi 4 starts throttling. The chip protects itself at 85 °C, but running consistently that hot means you are losing the performance you overclocked for.

Is overclocking worth it on a Raspberry Pi 4 or 5?

The gains are modest. A Raspberry Pi 4 can typically go from 1.8 GHz to around 2 GHz, a small but noticeable bump in CPU-bound tasks. On a Pi 5 the practical win is usually better cooling so it never throttles, rather than a higher clock.

How long should a stress test run?

At least 15 minutes as a quick check, and ideally an hour or your typical real workload before calling the overclock stable. If it survives that with get_throttled reporting 0x0, it is likely solid.

Do I need to change the voltage?

Usually not for mild overclocks. Only add over_voltage if a documented frequency is unstable at stock voltage, and stay within the values in the official documentation for your model.