How to Add a Favicon to Your Website

How to Add a Favicon to Your Website

You might come across the term favicon when it comes to web design and development. But what is it exactly? Well, in this article, we’ll be answering your question and showing you how to add a favicon to your website. Let’s get started!

Extremely fast, secure, and user-friendly web hosting for your successful online projects! And a 30-day money-back guarantee!

Get Started

What is a Favicon, and Why is It Important?

Simply put, a favicon is your website logo that appears next to the meta title on your browser tab. In other words, instead of showing a blank document icon on the browser, your website will display your official website icon.

Most websites usually use their logo as a favicon. If your website doesn’t have a logo, you can simply create one with the free logo maker. This way, your visitors will easily notice your website when they’re opening a lot of tabs in a single browser window. Plus, your site will look much more professional.

Hostinger website's favicon

How to Add a Favicon to Your Website?

Pick one of two ways below to add a favicon to your website!

Let Browsers Automatically Generate the Icon

The easiest way to add an icon to your site is by uploading it as a .png or .ico file from your hosting’s File Manager. Follow these steps to do so:

  1. Prepare a square dimensioned image in .png or .ico format for your website logo.

    If you already have a .png file, use it. However, convert the image to .ico format using if you ever need to.

  2. Rename the .png or .ico image to favicon.

    Most browsers automatically detect favicon.png and favicon.ico file located in your website directory as your website’s icon. So, you’ll need no coding.

  3. Access your public_html folder by heading over to your hPanel, then File Manager -> Go To File Manager.
    Uploading the favicon.ico file to your wordpress directory to add a favicon to your website
  4. Upload the favicon.png or .ico file into your public_html folder. Reload your website, and you’ll see the favicon.

Upload a Regular Image and Edit Your Theme’s header.php File

Alternatively, if you have an image other than .png or .ico format (jpg, BMP, gif, etc.), you can use it as your website’s icon as well. However, you need to modify the header.php file on your currently used theme folder. To do so, perform these steps on your hPanel.

  1. Once you’ve got a square dimensioned image as your logo, head over to File Manager -> Go To File Manager -> public_html.
  2. Upload the image into your public_html folder.
    Uploading a jpg image as a favicon

    You may both keep the original name of the image or rename it to favicon. It’s recommended to rename the icon to distinguish it from other images.

  3. Go to the wp-content -> themes folder. Then, access the theme folder you’re currently using.
  4. Open the header.php file and paste this following syntax just before the end of the <head></head> tag:
    <link rel="shortcut icon" type="image/jpg" href="/favicon.jpg"/>

    Inserting code into the header.php file to add a favicon

    Change the /jpg and /favicon.jpg parts according to the format and the name of the image you’re about to use.

  5. Once you’ve saved your changes, the image should now display as your website’s icon.

If you can’t see the new favicon, clear your browser cache and restart your browser.


As you can see, having a favicon on your website is crucial. Not only does it make your site distinguishable on browser tabs, but it also gives a professional look to your website.

You can add it automatically by uploading a .png or .ico image named favicon to your public_html folder. Alternatively, you can upload a regular image (jpg, BMP, gif, etc.) and modify the header.php file within your currently used theme folder.

Was this tutorial helpful? Leave a comment below!

The Author


Linas L. / @linas

Linas started as a customer success agent and is now a full-stack PHP developer at Hostinger. He is passionate about making a positive impact on people by utilizing user-driven development techniques. As much as he enjoys coding and changing the world, he secretly dreams of becoming a rock star.

Related tutorials


ahmad Reply

December 25 2017



Mr Vaga Reply

April 22 2018

Try useful tool to generate favicon/icon online for website, applications & more. Hope you like it!


Ahmad Reply

February 20 2020

it's really understandable thanks


Dave Reply

April 10 2020

I looked this up a couple days ago. I don't know how I searched, but information was limited. I ended up on some kind of W3 spec sheet and figured, forget this. This search, wow. So easy. THANK YOU


Francis Reply

April 17 2020

I did this on my site and it's not working. when i refresh i dont see any favicon


    Andrius S.

    Replied on April 20 2020

    Hey Francis, If you can’t see the new favicon, clear your browser cache and restart your browser. Let me know if it worked.


Robin Reply

July 16 2020

Brilliant. That's so much quicker than trying to do it through the CMS. Cheers. Robin


Allen W McCullough Reply

October 15 2020

uhh, so if I am using hostinger's site builder and not wordpress, this is not helpful.



    Replied on February 02 2021

    Hi there, Allen! If you're using our legacy Website Builder, you can find how to create a favicon here.

Leave a reply




This site uses Akismet to reduce spam. Learn how your comment data is processed.

Become a part of Hostinger now!

More in Website
How to Check if Website is Down or Working Worldwide