4 min read · Free · No login needed
Look at your browser tabs. Each one has a small icon on the left of the title — that is the favicon (short for "favourite icon"). It is your website's tiny logo. Without one, the browser shows a plain default icon, and your site looks unfinished.
Make a small square image — 32×32 or 48×48 pixels is enough — save it as favicon.ico or favicon.png, put it in your website's main folder, and add this line inside the <head> of your page:
<link rel="icon" type="image/png" href="favicon.png">
Use any image editor to shrink your logo to a small square. Free online tools like favicon.io can turn a PNG or a letter into a proper favicon file in seconds. Keep the design very simple — at 16 pixels wide, fine details disappear. A single letter or a bold shape works best.
Besides browser tabs, the favicon shows up in bookmarks, in the browser history, and on the phone home screen when someone saves your site. It is a small detail, but it makes your site look professional and easy to recognise.
A favicon is the tiny icon a browser shows next to your page title — in the tab, in bookmarks, and in the browser history. It is usually 16 by 16 pixels, so small that you can barely see the detail. But it makes your site look finished and professional, and it helps visitors find your tab among twenty open ones.
| Attribute | Value | Description |
|---|---|---|
rel | icon | Tells the browser this link is the page icon. |
type | image/png, image/x-icon | The file format of the icon. |
sizes | 16x16, 32x32 | The size of the icon, so the browser can pick the right one. |
href | a file path | Where the icon file is. |
The link goes in the <head>. You can offer more than one size — the browser picks the best fit:
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32.png"> <link rel="icon" type="image/png" sizes="16x16" href="favicon-16.png">
.ico, which can hold several sizes in one file and works in every browser, even very old ones. A modern .png works in all current browsers and is easier to create from a logo.<link> in the <body> — it belongs in the <head>.<link rel="icon" type="image/png" href="favicon.png"> sits inside the <head> and tells the browser which file is the page icon — rel="icon" says what the link is, type says the format, and href says where the file is.<title>Favicon</title> sets the text the tab shows, and the browser places the favicon just to the left of it.<h1>My Site</h1> and the paragraph are the visible page content, while the favicon itself never appears in the body — it shows in the browser tab next to the title.<!DOCTYPE html>
<html>
<head>
<title>Favicon</title>
<link rel="icon" type="image/png" href="favicon.png">
</head>
<body>
<h1>My Site</h1>
<p>Look at the browser tab — it shows my favicon.</p>
</body>
</html>Change the code below and press Run to see the result instantly. No file to save, no login needed.
The questions learners ask most about this lesson — read the question, then open it to see the answer.
It is the tiny icon shown next to the page title in the browser tab, bookmarks, and history.
Save a small square image and add a link with rel icon inside the head of the page.
Browsers cache favicons aggressively, so hard-refresh the page or open it in a private window to check the new one.
AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.
Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.
Take the testPrefer watching? Video courses teach the same topics step by step.
Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.
Browse all coursesAsk about courses, website & more
Request human callback:
Please log in to download. You will stay on this page after logging in!
New here? Register now →