agyanadda@gmail.com

HTML Favicon

HTML Media 1 min read Updated Nov 30, 2026 Topic 23 of 33

A favicon is the small icon shown in the browser tab, bookmarks and history.

How to add one

  1. Make a small square image (for example 32×32 or 512×512 pixels). PNG, SVG or ICO all work.
  2. Save it in your website folder, for example favicon.png.
  3. Add a <link> tag inside <head>.

You can also add an apple-touch-icon for when people save your site to their phone home screen.

Example

Example — Add a favicon HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Site</title>
  <link rel="icon" type="image/png" href="/favicon.png">
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
</head>
<body>
  <p>Look at the browser tab for the icon.</p>
</body>
</html>

Test Yourself With Exercises

Exercise 1 Fill in the Blank

The favicon is added with a <link rel="___"> tag.

Exercise 2 True / False

The favicon link goes inside the <head>.

Frequently Asked Questions

Browsers cache favicons for a long time. Hard-refresh (Ctrl+F5) or open the site in a private window.