thumb|280px|[[Wikipedia's favicon, shown in Firefox]]

A favicon (; short for favorite icon), also known as a shortcut icon, website icon, tab icon, URL icon, or bookmark icon, is a file containing one or more small icons A web designer can create such an icon and upload it to a website (or web page) by several means, and graphical web browsers will then make use of it. A side effect was that the number of visitors who had bookmarked the page could be estimated by the requests of the favicon. This side effect no longer works, as all modern browsers load the favicon file to display in their web address bar, regardless of whether the site is bookmarked.

Standardization

In 2003, the <code>.ico</code> format was registered by a third party with the Internet Assigned Numbers Authority (IANA) under the MIME type <code>image/vnd.microsoft.icon</code>. However, when using the <code>.ico</code> format to display as images (that is, not as favicon), Internet Explorer cannot display files served with this standardized MIME type.

RFC 5988 established an IANA link relation registry, and <code>rel="icon"</code> was registered in 2010 based on the HTML5 specification. The popular <code><link rel="shortcut icon" type="image/png" href="image/favicon.png"></code> theoretically identifies two relations, <code>shortcut</code> and <code>icon</code>, but <code>shortcut</code> is not registered and is redundant. In 2011 the HTML living standard specified that for historical reasons <code>shortcut</code> is allowed immediately before <code>icon</code>; however, <code>shortcut</code> does not have a meaning in this context.

Legacy

Internet Explorer 5–10 supports only the ICO file format. Netscape 7 and Internet Explorer versions 5 and 6 display the favicon only when the page is bookmarked, and not simply when the pages are visited as in later browsers.

Examples of favicons

<gallery size="50px">

File:Etsy icon.svg|alt=|Etsy

File:Google_Favicon_2025.svg|Google

File:Microsoft icon.svg|alt=|Microsoft

File:PayPal Logo Icon 2014.svg|alt=|PayPal

File:Roblox player icon black.svg|alt=|Roblox

File:Spotify icon.svg|alt=|Spotify

File:Wikipedia's_W.svg|alt=|Wikipedia

File:X logo 2023.svg|alt=|X (formerly Twitter)

File:YouTube full-color icon (2024).svg|alt=|YouTube

</gallery>

Browser implementation

The following tables illustrate support of various features with major web browsers. Unless noted, the version numbers indicate the starting version number of a supported feature.

Image file format support

The following table illustrates the image file format support for the favicon.

{| class="wikitable" style="text-align: center"

|-

!rowspan=2|Browser

!colspan=8|Image file format

|-

!ICO

!PNG

!GIF

!Animated GIFs

!JPEG

!APNG

!SVG

!WebP

|-

|Edge

|

|

|

|

|

|

|

|

|-

|Firefox<!--Firefox "start" or earliest version I used is version 1, although it is supporting since beginning!: mabdul -->

|<!--This reference is totally ok: Mozilla was later changed to the Gecko (layout engine) and thus becoming the "underground" for firefox!-->

|

|

|

|

|-

|Google Chrome

|

|

|

|

|

|

|

|

|-

|Internet Explorer

|

|

|

|-

|Opera

|

|

|

|-

|Safari

|

|

|

|

|

|

|

|

|}Additionally, such icon files can be 16×16, 32×32, 48×48, or 64×64 pixels in size, and 8-bit, 24-bit, or 32-bit in color depth. The ICO file format article explains the details for icons with more than 256 colors on various Microsoft Windows platforms.

Use of favicon

This table illustrates the different areas of the browser where favicons can be displayed.

{| class="wikitable" style="text-align: center;"

|-

! Browser

! Address bar

! Address bar drop-down list

! Links bar

! Bookmarks

! Tabs

! Drag to desktop

|-

|Edge

|

|

|

|

|

|

|-

|Firefox

|

|

|

|

|

How to use

This table illustrates the different ways the favicon can be recognized by the web browser. The standard implementation uses a link element with a <code>rel</code> attribute in the <code><nowiki><head></nowiki></code> section of the document to specify the file's format, name and location.

{| class="wikitable sortable" style="text-align: center;"

|-

!

! Edge

! Firefox

! Google Chrome

! Internet Explorer

! Opera

! Safari

|-

! style="text-align: left" | <syntaxhighlight lang="html"><link rel="shortcut icon"

href="https://example.com/myicon.ico"></syntaxhighlight>

|

|

|-

!<code>favicon.ico</code> located in the website's root

|

|

|

|

|

|

|-

!precedence: prefer root or (X)HTML linked version

|linked

HTML5 recommendation for icons in multiple sizes

The current HTML5 specification recommends specifying multiple sizes for the icons, using the attributes <code>rel="icon" sizes="space-separated list of icon dimensions"</code> within a <code>&lt;link&gt;</code> tag. Multiple icon formats, including container formats such as Microsoft .ico and Macintosh .icns files, as well as Scalable Vector Graphics may be provided by including the icon's content type in the format <code>type="file content-type"</code> within the <code>&lt;link&gt;</code> tag.

As of iOS 5, Apple mobile devices ignore the HTML5 recommendation and instead use the proprietary <code>apple-touch-icon</code> method detailed below. The Google Chrome web browser however, will select the closest matching size from those provided in the HTML headers to create 128×128 pixel application icons, when the user chooses the Create application shortcuts... from the "Tools" menu.

Home screen icons on mobile devices

On mobile devices, users can pin web pages as shortcuts icons to their home screen. These shortcut icons look similar to regular apps and web developers can provide dedicated icons for them.

Apple devices

For Apple devices with the iOS operating system version 1.1.3 or later, users can pin a website to the home screen using the Add to Home Screen button within the share sheet in Safari.

This works for any website. But for iOS to display the shortcut with an icon, the website needs to supply a in the section of documents served by the website. If the custom icon is not provided, a thumbnail of the web page will be put on the home screen instead.

The app icon sizes on the different device classes differ. The recommended sizes for the icons are 152×152 for iPads (until iPad 2, released in 2011), 167×167 for iPads with Retina screens (iPad 3 and later) and 180×180 for iPhones. If no icon in the matching size is provided, iOS will pick the largest icon with <code>rel="apple-touch-icon"</code> and scale it automatically.

Example code:

<syntaxhighlight lang="html"><!-- For iPad -->

<link rel="apple-touch-icon" type="image/png" sizes="167x167" href="favicon-167x167.png"></syntaxhighlight>

<syntaxhighlight lang="html"><!-- For iPhone -->

<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="favicon-180x180.png"></syntaxhighlight>

The icon file referenced by <code>apple-touch-icon</code> is modified to add rounded corners. On the iOS versions prior to iOS 7, a drop shadow, and reflective shine would be added, and <code>apple-touch-icon-precomposed</code> icon may be provided to instruct devices not to apply reflective shine on the image.

Example code: However, providing a web manifest file is not necessary for the Add to home screen feature to work.

Limitations and criticism

Due to the need to always check for it in a fixed location, the favicon may lead to artificially slow page-load times and unnecessary 404 entries in the server log if it is nonexistent.

Favicons are often manipulated as part of phishing or eavesdropping attacks against HTTPS web pages. Many web browsers display favicons near areas of the web browser's UI, such as the address bar, that are used to convey whether the connection to a website is using a secure protocol like TLS. By changing the favicon to a familiar padlock image an attacker can attempt to trick the user into thinking they are securely connected to the proper website. Automated man-in-the-middle attack tools such as sslstrip utilize this trick. In order to eliminate this, some web browsers, such as Firefox or Google Chrome, display the favicon within the tab whilst displaying the security status of the protocol used to access the website beside the URL.

Since favicons are usually located at the root of the site directory on the server, they can be employed with some reliability to disclose whether a web client is logged into a given service. This works by making use of the redirect-after-login feature of many websites, by querying for the favicon in a redirect-after-login URL and testing the server response to discern whether the user is given the requested resource (which means they are logged in), or instead redirected to the login page (which means that they are not logged into the service).

In 2021, a method for browser tracking using favicons was demonstrated by researchers at the University of Illinois.

References

  • W3C web standards organization on how to add a Favicon
  • Systems and Methods Involving Favicons 2008 patent application