How to add a favicon in HTML?

A simple picture file in the PNG or ICO (Windows icon) formats should serve as your favicon. A favicon should have a size of 16 by 16 pixels. Add this line of code to the <head>
Section of your HTML document:

<link rel="icon" type="image/png" href="path/to/favicon.png">

As an alternative, you can use the following code if your favicon is in ICO format: <link rel="icon" type="image/x-icon" href="path/to/favicon.ico">

Go from files to website in seconds.

Start a free trial for 7 days — no credit card required

Get Started for Free