Skip to main content

What is a favicon?

Favicon (short for "favorite icon") is a small site icon that is displayed:

  • on the browser tab next to the page title,
  • in bookmarks (favorites),
  • in the history list,
  • in search results and on the smartphone screen, if the site is added as a shortcut.

1. Example of a favicon on a tab

javascript
[icon] Wikipedia - The Free Encyclopedia

[icon] ← this is exactly the favicon, the site's visual symbol.


2. How a favicon is linked

A favicon is linked using the <link> tag inside <head>:

html
<link rel="icon" href="/favicon.ico" type="image/x-icon">

Main parameters:

  • rel="icon": indicates that this is the site icon;
  • href: the path to the file (can be .ico, .png, .svg, and so on);
  • type: the image's MIME type (optional).

3. Modern favicon formats

FormatFeaturesExample
.icoClassic format, supported by all browsersfavicon.ico
.pngModern format with transparencyfavicon.png
.svgVector icon, scales without losing qualityfavicon.svg
.gifAn animated icon can be used (rare)favicon.gif

4. Where a favicon is used

LocationExample
Browser tabnext to the page title
Bookmarks (favorites)when saving the site
Browsing historynext to the site name
On mobile deviceswhen adding to the home screen
In Google search resultsnext to the site's URL (for brand trust)

5. File location

By default, browsers look for the favicon at the site root:

javascript
https://example.com/favicon.ico

But it is better to always specify the path explicitly via <link>, this is more reliable.


6. Examples of linking different formats

html
<link rel="icon" type="image/png" href="/icons/favicon-32x32.png" sizes="32x32"> <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png"> <link rel="icon" type="image/svg+xml" href="/icons/favicon.svg">
  • apple-touch-icon: the icon for iPhone / iPad when the site is added to the screen.
  • sizes: specifies the icon's size for adaptive selection.

Summary:

CharacteristicDescription
PurposeSite icon for tabs, bookmarks, and search
Linking tag<link rel="icon" href="favicon.ico">
LocationInside <head>
Formats.ico, .png, .svg
SizeUsually 16×16 or 32×32 pixels
ImportanceImproves brand recognition and site trust

In simple terms: a favicon is the site's "mini-logo", which makes the tab recognizable and professional. Without it, the site looks "empty" and less trustworthy.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.