HTML Favicon Explained

HTML Favicon Explained

HTML Favicon – Add an Icon to Your Browser Tab | TipsInLearning
Home HTML Course HTML Favicon
Lesson 14 of 22

HTML Favicon

Learn how to add a professional favicon to your website — the small icon that appears in browser tabs and bookmarks. Covers ICO, PNG, SVG formats, Apple Touch Icon, and dark mode support.

8 min read
Beginner
Branding
A favicon is one of the smallest files on your website but it does disproportionate work for your brand. Every time someone has ten tabs open, your favicon is what lets them find your site instantly. It also helps with AdSense approval — sites without favicons look incomplete to Google's reviewers, and completeness signals genuinely matter during review.
What You'll Learn
What a favicon is and where it appears
Add a favicon with one line of HTML
ICO, PNG, and SVG format differences
Multiple sizes for different devices
Apple Touch Icon for iOS home screens
Dark mode favicon support

What is a Favicon?

A favicon (short for "favorite icon") is the small icon that appears next to your page title in the browser tab, in bookmarks, in browser history, and sometimes in Google search results. It's usually 16×16 or 32×32 pixels — tiny, but immediately recognizable.

Favicons are added via a <link> tag in your HTML <head>. Browsers also automatically look for a file named favicon.ico in your site's root directory — so placing an ICO file there gives you basic favicon support with zero HTML needed.

What a favicon looks like in a browser tab:

HTML Favicon — TipsInLearning

Appears before the page title in every browser tab, bookmark, and history entry

Where favicons appear: Browser tabs, bookmarks bar, browser history, address bar dropdown, search engine result pages (some engines), and on mobile home screens when users install your site as a PWA. One favicon link tag covers all of these.

Why Add a Favicon?

Branding
Reinforces identity on every browser tab
Usability
Users find your tab instantly among many
AdSense
Sites without it look unfinished to reviewers
PWA Icon
Home screen icon when users install your site

How to Create a Favicon

Step 1 — Design your icon

Keep it simple. At 16×16 pixels, complex designs become unreadable blobs. A single bold letter, a simple geometric shape, or a clear symbol works best. Use contrasting colors so it's visible on both light and dark browser UIs. Design in Figma, Canva, or even a simple image editor.

Step 2 — Generate the files

Use a free generator: favicon.io or realfavicongenerator.net. Upload your image and they output ICO, PNG (multiple sizes), and SVG versions automatically. Download the zip, extract the files, and upload them to your site's root directory.

Step 3 — Add link tags to every page's <head>

On Blogger, edit your theme template to add the tags to the global header — they'll appear on every page automatically. See the code examples below.

Favicon Formats

.ico
Legacy format — works in all browsers including old ones. Can contain multiple sizes.
.png
Transparent backgrounds, widely supported by modern browsers.
.svg
Best for modern sites — scalable, tiny file, supports dark mode. Recommended.
Best approach: SVG as primary favicon + ICO as fallback. Browsers use the best format they support. SVG handles every modern browser at any resolution. ICO handles legacy browsers. Both in the same head section.

Add Favicon to Your Website

HTML — basic favicon setup
<!-- Inside <head> -->

<!-- SVG favicon (modern, recommended) -->
<link rel="icon" type="image/svg+xml"
      href="/favicon.svg" />

<!-- ICO fallback (legacy browsers) -->
<link rel="icon" type="image/x-icon"
      href="/favicon.ico" />

<!-- Apple Touch Icon — 180x180 for iOS home screen -->
<link rel="apple-touch-icon"
      href="/apple-touch-icon.png" />

Multiple Sizes — Full Setup

For the best experience across all devices, provide several sizes. A favicon generator handles this automatically:

HTML — complete favicon setup
<!-- Modern browsers (SVG — scales to any size) -->
<link rel="icon" type="image/svg+xml" href="/favicon.svg"/>

<!-- Legacy ICO fallback -->
<link rel="icon" type="image/x-icon" href="/favicon.ico"/>

<!-- PNG sizes for specific browsers -->
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>

<!-- Apple: 180x180 for iOS home screen -->
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png"/>

<!-- Android PWA: 192x192 -->
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png"/>

Dark Mode Support

Some browsers support different favicons for light and dark mode. This is useful when your favicon has a dark logo that disappears on dark browser UIs — serve a light version for dark mode:

HTML — dark mode favicon
<!-- Light mode favicon -->
<link rel="icon" href="/favicon-light.svg"
      media="(prefers-color-scheme: light)"/>

<!-- Dark mode favicon -->
<link rel="icon" href="/favicon-dark.svg"
      media="(prefers-color-scheme: dark)"/>
Browser cache: Favicons are cached aggressively. After changing yours, always test in a hard refresh (Ctrl+Shift+R / Cmd+Shift+R) or incognito window. Regular users may see the old favicon for a while until their cache expires — this is normal.
Try It — Add a Favicon
1Go to favicon.io and create a text favicon using your site's initials. Download the generated files.
2Add the SVG and ICO link tags to the <head> of your HTML page
3Open the page in a browser — you should see your favicon in the browser tab
4On your phone: open the page, tap Share → Add to Home Screen — your Apple Touch Icon appears as the app icon
Lesson Summary
1Favicons appear in browser tabs, bookmarks, and history — they instantly communicate your brand
2Add with <link rel="icon" href="..."> in the HTML <head> section
3SVG is the best modern format — scalable, tiny file size, dark mode support
4Include ICO as fallback for legacy browsers and Apple Touch Icon (180x180) for iOS
5Keep design simple — at 16px it needs to be recognizable as a single bold shape or symbol
6Hard refresh (Ctrl+Shift+R) to see changes — browsers cache favicons very aggressively

Questions & Answers

Common questions beginners ask about this topic:

I added the favicon link tag but nothing shows in the tab. Why?

Favicons are cached very aggressively by browsers. After adding or changing a favicon, do a hard refresh: Ctrl+Shift+R on Windows/Linux or Cmd+Shift+R on Mac. If that still doesn't work, test in an incognito/private window which starts without any cache. You can also paste the favicon URL directly into the browser address bar and confirm it actually loads — if you get a 404, the file path is wrong. On Blogger, make sure the file is publicly accessible.

What size should my favicon be?

The base favicon.ico should contain both 16x16 and 32x32 pixel versions (ICO files can contain multiple resolutions in one file). Modern browsers prefer 32x32. For Apple devices (iOS home screen), provide a separate 180x180 PNG as apple-touch-icon. For Android PWAs, 192x192 and 512x512 are standard. SVG format handles all modern browsers with one file at any size — it's the cleanest solution.

What's the best favicon format — ICO, PNG, or SVG?

SVG is the best choice for modern browsers — it scales to any size perfectly, has tiny file size, and supports dark mode switching. For backward compatibility, also include an ICO fallback. ICO files are the legacy format but work everywhere including older browsers. PNG is a good middle ground — transparent background, widely supported, easy to generate. The professional approach: SVG as primary + ICO as fallback, plus a 180x180 PNG for Apple Touch Icon.

Does a favicon help with AdSense approval?

Yes — Google's reviewer checklist includes signs that a site is complete and professional. A missing favicon is a small red flag that adds up with other incompleteness signals. It won't get you approved or rejected on its own, but combined with a proper About Us page, Privacy Policy, real content, and working navigation — a favicon is part of presenting a polished, legitimate site. It's also the simplest item on the completeness checklist to fix.

Can I use an emoji as a favicon?

Yes — it's a popular trick for personal sites and blogs. Create an SVG file with a <text> element containing your emoji. It renders at any size without pixelation and requires no image editor. The downside is emoji look slightly different across operating systems (Windows, Mac, Android), so the same emoji may look different for different users. For a professional brand, a custom icon is better. For a personal blog, an emoji favicon is perfectly reasonable.

Post a Comment

Previous Post Next Post