How to Remove Black Border From Raspberry Pi Display

display with black border

One problem I often have when setting up a new Raspberry Pi on a display, is that the display doesn’t stretch to the entire area of the screen. Rather, there is a black border between the content on the screen and the display’s bezel. So annoying!

The following is what fixed the problem for me on multiple Raspberry Pi’s and displays. I’m using the latest (as of this post) Raspbian Stretch October 2018 version. If on a different version, the solution might be slightly different, but hopefully it works for you.

To get rid of the black border, we have to edit the config.txt file in the /boot directory.

To do that, open the terminal or SSH into your Pi.

In the terminal, type the following command:

sudo nano /boot/config.txt

This will open the config.txt file in nano, a simple text editor that runs in the terminal.

The file is about 60 lines of text or so. Use the Up/Down Left/Right buttons on your keyboard to navigate the document in nano.

Find the following line:


Now remove the # in front of the command so it reads:


Anything with a hashtag in front of it is treated as a comment, meaning the computer ignores it. So by uncommenting the line (removing the hashtag), the computer will execute the command.

Type Ctrl+x on your keyboard to exit nano, and a little message at the bottom or the terminal will say, “save modified buffer?’.

Type y for ‘yes’.

Then the file name appears at the bottom of the screen. Don’t change it and hit Enter on the keyboard to save your changes.

This will save the file, and exit nano back into the terminal.

Now all you have to do is reboot your Pi.

Type the following into your terminal:

sudo reboot now

And hit Enter.

Your Pi should reboot without the annoying black border.

13 comments on “How to Remove Black Border From Raspberry Pi Display

    1. In setting up my new Pi 4b I hit “yes” to remove black border. This was wrong as now icons are half off the screen how do I revert back to original setting.

      1. Open the file config.txt inside the folder /boot with the bash command sudo nano /boot/config.txt and justput a # before disable_overscan=1 or change the 1 with a 0, save the file config.txt with ctrl+x confirming with y and reload the system with sudo reboot now. Exactly as Martin just wrote up…

  1. Along behind the times, thing developments have then developed throughout the world.
    The number of further businesses that we don’t even know of exist because there are
    too many of them. Similarly, the gambling business, of course
    there are as well as many names of gambling agents that have sprung up.
    However, the emergence of these agents does not always have the funds for
    a fine unorthodox for gamblers, both upscale and beginner gamblers.
    when hence many gambling agents popping up, certainly not every agents can be trusted because too many
    gambling issue worlds want to take on more profits without thinking practically the long-term impact.
    Both members and for their own business.

    Ensuring Bandar Legality

    Therefore official agent2018 wants to manage to pay for an easy
    exaggeration to locate a trusted gambling agent site.
    The endeavor is that you can have an idea, how to handle the situation. subsequently you are in a give access already trapped by fraud
    traps. Because we every know in that perspective it’s impossible to acquire out soon. You are with complacent, hence you are
    not up to date that you are nevertheless under the
    move of fraud from irresponsible agents.

    To locate out the qualified gambling agent is extremely easy, create definite as soon as you visit the gambling site, whether it’s a gambling
    site or similar, it’s a fine idea to ask the customer encourage whether the site
    is endorsed or not by asking for proof of ID number or belong to that can prove the existence of the site recognized soccer gambling
    is valid and possible to operate, usually an qualified online gambling
    site. Always has an office in the Philippines and is below the aegis of Cagayan or Pagcor, and has real immunity and authority.
    Which is protected by the give access of the Philippines, because the solitary country in Asia that is competent to find
    the money for licenses for online gambling event sites, is on your own in the
    Philippines. simple ample right? To locate a trusted
    online soccer betting site.

  2. Great article. When I saw the setting I remembered that there is a GUI way to change it in the Preferences>Raspberry Pi Config>Display so you can now enable/disable that setting. Thanks for putting me on the right track.

  3. Perfect! I wonder if this is intentional to help users learn terminal?
    I now have fixed the issue and learned the command line!

Leave a Reply

Your email address will not be published. Required fields are marked *