Favicon

A favicon (/ˈfæv.ɪˌkɒn/; 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[1] associated with a particular website or web page.[1][2] 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.[3] Browsers that provide favicon support typically display a page's favicon in the browser's address bar (sometimes in the history as well) and next to the page's name in a list of bookmarks.[3] Browsers that support a tabbed document interface typically show a page's favicon next to the page's title on the tab, and site-specific browsers use the favicon as a desktop icon.[1]
History
[edit]
In March 1999, Microsoft released Internet Explorer 5, which supported favicons for the first time.[4] Originally, the favicon was a file called favicon.ico placed in the root directory of a website. It was used in Internet Explorer's favorites (bookmarks) and next to the URL in the address bar if the page was bookmarked.[4][5][6][7] 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.[6]
Standardization
[edit]In 2003, the .ico format was registered by a third party with the Internet Assigned Numbers Authority (IANA) under the MIME type image/vnd.microsoft.icon.[8][9] However, when using the .ico format to display as images (that is, not as favicon), Internet Explorer cannot display files served with this standardized MIME type.[9] A workaround for Internet Explorer is to associate .ico with the non-standard image/x-icon MIME type in web servers.[10]
RFC 5988 established an IANA link relation registry,[11] and rel="icon" was registered in 2010 based on the HTML5 specification. The popular <link rel="shortcut icon" type="image/png" href="image/favicon.png"> theoretically identifies two relations, shortcut and icon, but shortcut is not registered and is redundant. In 2011 the HTML living standard[12] specified that for historical reasons shortcut is allowed immediately before icon;[13] however, shortcut does not have a meaning in this context.
Legacy
[edit]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.[4]
SVG favicons
[edit]Today all modern browsers support SVG favicons[14] that stay sharp at any size because they are vector graphics. It's most sensible to use them because a single <link>-entry can cover all icon sizes while staying sharp and having a small file size. Further SVG favicons can even adjust their colors according to whether the web browser is set to light or dark mode.[15][16]
Examples of favicons
[edit]- X (formerly Twitter)
Browser implementation
[edit]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. Many browsers such as Google Chrome, Microsoft Edge and Opera are based on Chromium (web browser). They use the same engine.
Image file format support
[edit]The following table illustrates the image file format support for the favicon.
| Browser | Image file format | |||||||
|---|---|---|---|---|---|---|---|---|
| ICO | PNG | GIF | Animated GIFs | JPEG | APNG | SVG | WebP | |
| Firefox | 1.0[17] | 1.0[17] | 1.0[17] | Yes[18] | Yes | 3.0[18] | 41.0[19] | Yes |
| Chromium | Yes | Yes | 4.0 | No[20][21] | 4.0 | No | 80[22] | Yes |
| Internet Explorer | 5.0[23] | 11.0[24] | 11.0[24] | No[23] | No[23] | No[23] | No[25] | No |
| Safari | Yes | 4.0 | 4.0 | No | 4.0 | No | Yes | Yes |
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.[1][3] The ICO file format article explains the details for icons with more than 256 colors on various Microsoft Windows platforms.
How to use
[edit]This table illustrates the different ways the favicon can be recognized by the web browser. The standard implementation uses a link element with a rel attribute in the <head> section of the document to specify the file's format, name and location.
The following ways to specify a favicon are supported in Firefox, Chromium and Safari:
<link rel="icon" type="image/svg+xml" href="/image.svg">
<link rel="shortcut icon" href="/myicon.ico">
<link rel="icon" type="image/vnd.microsoft.icon" href="/image.ico">
<link rel="icon" type="image/x-icon" href="/image.ico">
<link rel="icon" href="/image.ico">
<link rel="icon" type="image/gif" href="/image.gif">
<link rel="icon" type="image/png" href="/image.png">
Internet Explorer does not support SVG favicons. Only Safari supports mask-icon:[26]
<link rel="mask-icon" href="/image.svg" color="red">
The Internet Explorer way (favicon.ico located in the website's root /) is still supported by all browsers for now. However if a linked favicon is specified, moder browsers will choose the linked favicon instead of the favicon in the root of the website.[27]
Firefox only accepts favicon.ico in the website's root without a <link> tag if the setting browser.chrome.site_icons is set to true in about:config. The default value is true. If set to false, these favicons are ignored.
Animated favicons
[edit]Various browsers such as Firefox and Opera support animation of favicons. A bug report has been open for Firefox since 2001 requesting a way to disable this feature.[28][29]
Limitations and criticism
[edit]The mechanism of loading /favicon.ico inherited from Internet Explorer is particularly bad. It is implemented universally but not part of any web standard. Due to the need to always check for favicon.ico in a fixed location, the favicon used to lead to artificially slow page-load times and unnecessary 404 entries in the server log if it is nonexistent.[6]
The W3C did not standardize the rel attribute, so there are other keywords such as shortcut icon that are also accepted by the user agent.[30][23]
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.[31] 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.[32]
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).[33]
In 2021, a method for browser tracking using favicons was demonstrated by researchers at the University of Illinois. It does not work against Firefox.[34]
Multiple resolutions
[edit]Nowadays, most modern browsers support having a single SVG favicon, which has the advantage of being scalable without losing its quality.
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
For the icon to appear on the Android home screen when a shortcut is created there, a minimal .webmanifest file may be needed for reasons unknown, which are likely to be a bug.[35]
HTML5 recommendation for icons in multiple sizes
[edit]The current HTML5 specification recommends specifying multiple sizes for the icons, using the attributes rel="icon" sizes="space-separated list of icon dimensions" within a <link> tag.[36] 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 type="file content-type" within the <link> tag.
As of iOS 5, Apple mobile devices ignore the HTML5 recommendation and instead use the proprietary apple-touch-icon 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
[edit]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
[edit]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.[37][38]
This works for any website. But for iOS to display the shortcut with an icon, the website needs to supply a <link rel="apple-touch-icon" ...> in the <head> 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.[39]
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 rel="apple-touch-icon" and scale it automatically.[40]
Example code:[41]
<!-- For iPad -->
<link rel="apple-touch-icon" type="image/png" sizes="167x167" href="favicon-167x167.png">
<!-- For iPhone -->
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="favicon-180x180.png">
The icon file referenced by apple-touch-icon is modified to add rounded corners. On the iOS versions prior to iOS 7, a drop shadow, and reflective shine would be added, and apple-touch-icon-precomposed icon may be provided to instruct devices not to apply reflective shine on the image.[38][39]
No HTML is required by browsers or mobile devices to retrieve these icons.[39] The website's root is the default location for the file apple-touch-icon.png (in order of priority).[38][39]
Android devices
[edit]On Android devices, users can use the Add to home screen function in Chrome's tools menu to pin a web page to their home screen.
This also works for any website, but if no favicon is provided, a generic icon is used. As Android app icons are sized in 48x48 points, websites should provide favicons sized in multiples of 48x48 pixels. For modern high resolution devices, Google recommends providing icons in 192x192 pixels.[42]
Example code:[41]
<!-- For Android -->
<link rel="icon" type="image/png" sizes="48x48" href="favicon-48x48.png">
<link rel="icon" type="image/png" sizes="192x192" href="favicon-192x192.png">
Android also supports Web Manifest files, which makes it possible to integrate web sites deeper within the system. A Web Manifest is a JSON file, that specifies meta data for a progressive web app. It allows the developer to not only provide the icons but also a short name for display on the home screen as well as theme colors.[43] However, providing a web manifest file is not necessary for the Add to home screen feature to work.[41]
References
[edit]- 1 2 3 4 Lane, Dave (9 August 2008). "Creating a Multi-Resolution Favicon Including Transparency with the GIMP". Egressive.com. Archived from the original on 25 December 2010. Retrieved 25 February 2011.
- ↑ "What's With Google's New Mini Icon?". BBC. 20 January 2009. Archived from the original on 30 December 2017. Retrieved 25 February 2011.
That 16x16 pixel square is the size of the favicon in question, if not the scope.
- 1 2 3 Apple, Jennifer. "Favicon — How To Create A Favicon.ico". Photoshopsupport.com. Archived from the original on 12 October 2004. Retrieved 25 February 2011.
- 1 2 3 "How to Add a Shortcut Icon to a Web Page". Microsoft Developer Network. Microsoft. Archived from the original on 5 January 2018. Retrieved 15 March 2010.
- ↑ McGrew, Darin (26 April 2007). "Web Authoring FAQ – 8.11. How can I have a custom icon when people bookmark my site?". htmlhelp.com. Archived from the original on 16 December 2019. Retrieved 23 February 2011.
- 1 2 3 Heng, Christopher (7 September 2008). "What is Favicon.ico? Personalise Your Site's Bookmarks". thesitewizard.com. Retrieved 23 February 2011.
- ↑ "Creating favicons with Adobe Photoshop and GoLive". Adobe GoLive. Archived from the original on 7 December 2003. Retrieved 25 February 2011.
- ↑ Butcher, Simon (3 September 2003). "Published specification". Internet Assigned Numbers Authority. Archived from the original on 4 October 2003. Retrieved 25 February 2011.
- 1 2 "IE9 RC Minor Changes List". IEInternals. Archived from the original on 24 March 2016. Retrieved 7 April 2016.
- ↑ Irish, Paul (15 December 2010). "commit 37b5fec090d00f38de64 to paulirish's html5-boilerplate". GitHub. Archived from the original on 18 October 2015. Retrieved 25 February 2011.
- ↑ "Link Relations". IANA. Archived from the original on 30 April 2020. Retrieved 1 November 2020.
- ↑ Ian Hickson (19 January 2011). "HTML is the new HTML5". The WHATWG Blog. WHATWG. Archived from the original on 6 October 2019. Retrieved 10 August 2011.
- ↑ "HTML attribute: rel - #icon".
- ↑ "SVG favicons | Can I use... Support tables for HTML5, CSS3, etc". caniuse.com. Retrieved 20 August 2026.
- ↑ "SVG Favicons — Modern Favicon Setup with Dark Mode Support". Xerobit. 11 May 2026. Retrieved 20 August 2026.
- ↑ Fayockon, Colby (29 August 2024). "Light & Dark Mode Favicons on Space Jelly". Space Jelly. Retrieved 20 August 2026.
- 1 2 3 David (19 July 2003). "Mozilla 0.9.6 Release Notes". Mozilla. Archived from the original on 19 September 2018. Retrieved 23 February 2011.
- 1 2 "Bug 111373: don't allow animated site icons (favicons)". Archived from the original on 9 October 2019. Retrieved 1 June 2014.
- ↑ Daniel Holbert (12 June 2015). "Bug 366324 – SVG site icons (favicons, shortcut icons) support – comment 55". Bugzilla@Mozilla. Mozilla. Archived from the original on 9 October 2019. Retrieved 12 June 2015.
- ↑ tracker, chromium. "no movement in favicon". chromium.org. Archived from the original on 18 February 2019. Retrieved 11 April 2016.
- ↑ tracker, chromium. "Animated Favicons not supported". chromium.org. Archived from the original on 8 November 2018. Retrieved 8 November 2018.
- ↑ "Support for SVG in favicons - Chrome Platform Status". 19 November 2019. Archived from the original on 4 January 2020. Retrieved 16 January 2020.
- 1 2 3 4 5 Davis, Jeff (27 December 2007). "why doesn't the favicon for my site appear in IE7?". jeffdav on code. Microsoft. Archived from the original on 9 June 2019. Retrieved 11 March 2013.
- 1 2 Eric Lawrence (7 September 2013). "Fun with Favicons". Microsoft. Archived from the original on 23 May 2021. Retrieved 25 June 2022.
- ↑ "SVG favicon support". Microsoft Connect. 3 May 2013. Archived from the original on 21 June 2016. Retrieved 4 September 2014.
- ↑ "Creating Pinned Tab Icons". Apple Inc. 12 December 2016. Archived from the original on 9 December 2019. Retrieved 9 April 2019.
- ↑ Francis, Lewis (11 December 2007). "Chart of modern browser support for favicon". informationgift.com. Archived from the original on 10 October 2019. Retrieved 23 February 2011.
- ↑ "Bug 111373 - don't allow animated site icons (favicons)". bugzilla.mozilla.org. 21 November 2001. Archived from the original on 9 October 2019. Retrieved 1 June 2014.
- ↑ "Firefox Bug 111373 - don't allow animated site icons (mozilla.org)". Hacker News. 7 July 2015. Archived from the original on 19 September 2018. Retrieved 7 July 2015.
- ↑ Dubost, Karl (24 October 2005). "How to Add a Favicon to your Site". World Wide Web Consortium. Archived from the original on 29 November 2019. Retrieved 25 February 2011.
- ↑ Marlinspike, Moxie (21 February 2011). "Defeating Ssl Using Sslstrip (Marlinspike Blackhat)". (see description of video). SecurityTube. Archived from the original on 13 July 2011. Retrieved 9 July 2011.
- ↑ "Firefox version 14 features". 18 July 2012. Archived from the original on 19 September 2018. Retrieved 18 July 2012.
- ↑ Linus, Robin. "Your Social Media Fingerprint". Archived from the original on 21 December 2019. Retrieved 14 October 2016.
- ↑ Goodin, Dan (19 February 2021). "New browser-tracking hack works even when you flush caches or go incognito". Ars Technica. Archived from the original on 20 February 2021. Retrieved 21 February 2021.
- ↑ "Include icon when Add to Home Screen from Android Chrome". Stack Overflow. Retrieved 20 August 2026.
- ↑ "HTML Living Standard, Section 4.6.6.6 'Link type "icon"'". WHATWG. Archived from the original on 21 December 2019. Retrieved 17 November 2015.
- ↑ "iPhone Human Interface Guidelines for Web Applications: Metrics, Layout Guidelines, and Tips". Apple Inc. Archived from the original on 4 June 2010. Retrieved 27 May 2010.
- 1 2 3 "Safari Web Content Guide: Specifying a Webpage Icon for Web Clip". Apple Inc. 15 November 2010. Archived from the original on 20 May 2023. Retrieved 2 June 2023.
- 1 2 3 4 McLellan, Drew (17 January 2008). "How To Set an Apple Touch Icon for Any Site". Allinthe head.com. Archived from the original on 4 April 2019. Retrieved 11 March 2011.
- ↑ "Configuring Web Applications". developer.apple.com. Archived from the original on 20 May 2023. Retrieved 3 July 2021.
- 1 2 3 "How to add a favicon to your website – The modern browser guide". Loqbooq Blog. Archived from the original on 11 July 2021. Retrieved 3 July 2021.
- ↑ "Material Design". Material Design. Archived from the original on 28 May 2018. Retrieved 3 July 2021.
- ↑ "Add to Home screen - Progressive web apps (PWAs) | MDN". developer.mozilla.org. Retrieved 3 July 2021.
External links
[edit]- W3C web standards organization on how to add a Favicon
- Systems and Methods Involving Favicons 2008 patent application