Learn how to set the screen resolution of your Raspberry Pi using the terminal and desktop interface.
Even though the Raspberry Pi tries to automatically work out the best resolution to use for a screen, this isn’t always a perfect science.
Displays can sometimes provide weird information back to the device that makes it difficult to work out the correct resolution.
With this guide, we will be showing you how you can manually set the resolution of your Raspberry Pi.
Setting the resolution can be done through both the desktop interface and the terminal.
Using the terminal, you will be shown how to use the Raspberry Pi configuration tool as well as how to modify the
/boot/config.txt file directly.
Here is a list of the equipment we recommend for this guide on setting the screen resolution of your Raspberry Pi.
If you are not using Raspbian Buster, try upgrading to Buster by using our guide.
Changing the Screen Resolution using the Desktop
In this section we are going to show you how to set the resolution of the screen using the desktop utilities.
1. While on the desktop interface of your Raspberry Pi, click the icon in the top-left hand corner of the screen.
Clicking this icon will bring up the start menu.
2. Within the start menu, hover over “Preferences“.
Then click “Screen Configuration” to load the tool that we are after.
3. With the tool loaded on our Raspberry Pi, we can use it to change the resolution.
First, you need to right-click the display that you want to modify the resolution of (1.).
Next, hover over “Resolution” (2.).
Hovering over this will show you a selection of resolutions you can set for this current display. To select a resolution, click the one you want (3.)
Once you have chosen the resolution that you wish to use, you need to apply it by clicking the green tick button (4.)
4. To confirm this change, you will need to click the “OK” button within 10 seconds.
This timer helps when you make a change that your screen doesn’t like. If you run into issues, wait 10 seconds for the settings to automatically revert.
Changing the Screen Resolution using the Terminal
In this section, we will be showing you two different ways of setting the screen resolution for your Raspberry Pi using the terminal.
The first of these methods rely on the Raspberry Pi Configuration Tool. The second method directly modifies the
Using the raspi-config Tool to Change the Resolution
1. To begin, open up the raspi-config tool by running the following command.
2. Within the configuration tool, use the arrow keys to scroll down to
7 Advanced Options.
Once selected, press the ENTER key to open the options page.
3. Now that we are in the “Advanced Options” settings page, we need to select the
A5 Resolution option.
With the option selected, press the ENTER key to open the page.
3. Here, you can select the resolution you want your Raspberry Pi to use.
Be sure that you select a resolution that your monitor can handle; otherwise it will not work correctly.
4. With a resolution selected, you can now exit out of the tool by pressing ESC.
When you go to exit the tool, you will be asked to restart your Raspberry Pi. Select “<Yes>” to restart your Pi and use the new resolution.
Once you Raspberry Pi has finished restarting, the device should now be using the resolution that you set.
If, for some reason, your screen will no longer display anything, try holding the SHIFT key during startup to revert to the default settings.
Modifying the Boot Configuration to Set the Resolution
It is also possible to set the resolution of your Raspberry Pi without using the desktop interface or the raspi-config tool.
To do this, we will need to modify the
config.txt file located in the
/boot/ folder. You can edit this file directly on the SD card if you don’t have easy terminal access.
Please note that this section can be a little tricky as there is much more to take in.
1. Begin by modifying the
If you are doing this on your Raspberry Pi, you can run the following command.
sudo nano /boot/config.txt
2. Next, you must work out if you want to use the CEA or DMT HDMI groups.
CEA stands for Consumer Electronics Association and is the display standard that is typically used on a TV.
This CEA HDMI group is represented by the number 1.
DMT stands for Display Monitor Timings and is the standard that is typically used by monitors.
The DMT HDMI group is represented by the number 2.
Depending on which one you use will dictate the settings you use in the next step.
Within this file, find and replace the following line.
Use the replacement for the HDMI group that you intend to use. If you are unsure, you can see the supported resolutions in the tables below.
For the CEA Group
For the DMT Group
3. With the HDMI group chosen, we need to select the resolution.
We do this by modifying the
hdmi_mode variable in the config file.
Below we have a trimmed down table showing some of the more used resolution settings for the Raspberry Pi.
If you want to view the full
hdmi_mode table, then view the official Raspberry Pi Video documentation.
Use this table to find the “
hdmi_mode” value for your resolution that is required for the next step.
CEA Display Resoluton Modes
|Raspberry Pi 4 Only. Use this when dealing with two 4k displays.
|Raspberry Pi 4 Only. To use this
hdmi_enable_4kp60=1 must be set in
DMT Display Resoluton Modes
4. Once you have found the
hdmi_mode number for your resolution, we can now go ahead and set it in the boot configuration file.
Make sure that you replace
[YOURHDMIMODE] with the number you found using our tables above.
6. Once you have set the HDMI mode and group, we can now save the file by pressing CTRL + X, then Y, followed by the ENTER key.
7. Now to apply the new resolution to your Raspberry Pi, you need to restart it using the command below.
7. If for some reason your display stops working after the change you can try holding the SHIFT key during startup.
Using this key will make the Raspberry Pi ignore our boot configuration file and load up with the default settings.
At this point in the guide, you should now have successfully managed to change the resolution on your Raspberry Pi.
If you have run into any issues with this guide, feel free to drop a comment below.