The 2022 Guide to FavIcons for Nearly Everyone and Every Browser
- Tools /
How to Create Favicons for Your Website
Once upon a time, creating a favicon only required making a single 16×16 pixel icon, and placing it in the root directory of a website. This still works today, albeit with some caveats. This post has been updated several times over the years to keep-to-date as devices and standards have changed and outright disappeared, like the ill-fated Google TV and its own separate favicon.
With modern devices, displays tend to feature high density (retina) displays. These devices and displays feature more pixels per square inch. The end result is much sharper text and images. Generally, graphics need to be optimized for high-resolution displays. The classic 16 x 16 pixel favicon appears pixelated on these devices and displays; thus, additional steps are needed. To make matters more confusing, many newer devices, for example, iOS and Android, have their preferred favicon replacements.
This is a how-to guide for creating favicons for (almost) every conceivable browser.
The goal is to provide the best results (non-pixelated) with the least amount of work, and most importantly, maintaining one’s sanity while doing so.
Image: NPR.org does not have a retina display favicon thus it appears pixelated
Specific interests? Here’s what we cover in this article:
- A brief history of the favicon.ico
- A (mostly) complete list of all the known Favorite Icon Sizes
- Why not SVGs?
- Sanity Check: Photoshop / Automator utilities
- What these utilities will not do
- Downloading the Photoshop / macOS Automator / Sketch Template
- How To Install Favicon Photoshop Action
- Using the Photoshop Action
- Using the automator Action
- Using the Sketch Template
- Supporting IE6 – IE10 (and the Safari problem)
- Using IconSlate to Create a Retina Favicon
- Online HTML + XML generator
A brief history of the Favicon.ico
The Favicon was originally introduced in March 1999 by Microsoft alongside Internet Explorer 5’s new “Favorites” tab. Microsoft’s nomenclature dubbed bookmarks in Internet Explorer as “Favorites”. Bookmarks in the favorites tab had the option of including a favorite icon next to each URL. If a website had a favicon.ico file placed in the root directory of its domain, the favorite bookmark entry would include the custom icon. Shortly after, in 2000, the World Wide Web Consortium (W3C) adopted the favicon for the HTML 4.0 (with intentionally vague specifications).
As early as 2001, web browsers began to adopt the favicon next to the URL and soon became ubiquitous across the web, migrating to the now-familiar browser tabs. Later, both Firefox and Safari added PNG support for Favicons, marking the first major change to the Favicon format. In 2008, after the launch of the initial iPhone, the favicon took one more major turn after Apple introduced the “apple-touch-icon.png”, a higher resolution version of the favicon used for pinning to iOS’s dock. This created the precedent for multiple favicon sizes and helped cement PNG as the preferred format over Microsoft Windows’ ICO file format.
The W3C, Recognizing the necessity for versatility, in HTML5 included a standard for multiple sizes for the favicon, which proliferated due to high-density displays (laptops for programming), new operating system user interfaces, browser changes, and mobile devices. Today we have custom favicons for everything from Google TVs to Microsoft Windows Metro tiles.
A (mostly) complete list of all the known Favorite Icon Sizes
Below is a compiled list of the current known favorite icon sizes, this list is based on the Favorite Icon Cheat Sheet. The greyed out are once legacy favicons, that can still be used but are no longer supported. Due to age, these have been eliminated from the favicons project.
|Standard for most desktop browsers
|Chrome Web Store icon & Small Windows 8 Star Screen Icon*
|Google Developer Web App Manifest Recommendation
Modern browsers and devices have switched to favoring scaling icons closest in size. ICO, GIF and PNG are all supported by Edge, Firefox, Chrome, Opera and Safari. SVGs and JPEGs are supported by all modern browsers (Not Internet Explorer), however Safari only supports SVG icons in technology preview. Animated GIFs are mostly unsupported.
These should be ignored unless you have a very particular use case.
|Standard iOS home screen (iPod Touch, iPhone first generation to 3G)
|iPad home screen icon
|GoogleTV icon *
|iPhone retina touch icon (Change for iOS 7: up from 114×114)
|IE10 Metro tile for pinned site*
|iPad touch icon (Change for iOS 7: up from 144×144)<
|iPad Retina touch icon
(change for iOS 10: up from 152×152, not in action. iOS 10 will use 152×152)<
|Opera Speed Dial icon
(Not working in Opera 15 and later)
|Chrome for Android home screen icon
|Opera Coast icon
When this article was originally written, this was a total list of 14 icons, counting the iOS changes. We can safely assume the iOS side has drastically dropped, by Apple’s stats floating at only 9% of devices using earlier than iOS 12. Using David Smith’s Audiobook app’s metrics, less than 2% of users are using below iOS 10 as of writing this.
So based on more sane principals, we can remove a lot of the noise. Google TV was last updated in 2010. Apple went Retina in 2010 with the iPhone 4 and with the Touch and iPad in 2012. Opera Speed Dial disappeared in 2013, Opera Coast was removed from the Android App store in 2017. So with the revised list, we are down to seven major favicons (unless you have a project with very particular legacy requirements). Microsoft required msapplication-TileColor and msapplication-TileImage meta tags in order for IE10 on Windows 8 to recognize the Favicons, which can be dropped off from the original list as well.
Lastly, Google’s Web App Manifest notes that Chrome accepts favicons in increments of 48px, and defaults to 192 or 512. For the sake of sanity, we’ll stick to only 192.
The 2022 total list
- 4 favicons (32 x 32, 128 x 128, 180 x 180 and 192 x 192)
- Links in your website’s <head> tag for each size
Previous iterations of this guide recommended using A special XML file for Windows’ (8.1 and above) start menu tiles ( IE11+ and Windows 10 requires a browserconfig.xml.) This can still be done but this is an Edge case (pun intended) the vast majority of users do not use Edge in Windows.
Why Not SVGs?
Some readers looking at this list may be wondering about Scalable Vector Graphics (SVG) as a smarter solution instead of generating icons at every conceivable resolution, as icons are one of the best use cases for vector imagery. As of writing this not every major browser supports SVG favicons. See CanIuse.com for more details.
Unoptimized PNGs from Photoshop tend to be quite large. I highly recommend for macOS users using the free application ImageOptim for lossless PNG compression, and Linux users use Trimage. Both are easy to use. Drag and drop all the newly created PNGs to shave off valuable kilobytes off images without any quality reduction. macOS/Linux users can also use PNGOUT, a command-line interface utility for PNG optimization.
For the more technically savvy, macOS users, the PNG optimization utility ImageAlpha (works in tandem with ImageOptim) allows users to use indexed color profiles even further to reduce file sizes.
Supporting IE6 – IE10 (and the Safari problem)
For the truly obsessive, IE10 and below do not support PNG favicons, only ICO. Depending on the source, IE10 and below still makes up for roughly 0.2%-1.4% North American web users in April 2017. Fortunately, month by month, this keeps decreasing but differs based on regions of the globe and even on a per-country / language basis. IE10 was released on September 4th, 2012, as the default browser in Windows 8 and included in Windows 7 SP1 but as Windows 10 slowly replaces Windows 8, Internet Explorer users are increasingly switching to Microsoft’s IE replacement, Edge.
If you choose to include a favicon.ico for old IE users, there is a major Safari caveat. As of writing this, if both a ICO and PNG are included in your HTML, the desktop version of Safari will use the ICO file instead of the PNG. This is a problem since most icon generators only create 16 x 16 pixel icons. Retina displays will show the less appealing 16 x 16 icon instead of the beautiful 32 x 32 PNG. However, at no expense to IE users, MS’s .ico file format can support both a 16 x 16 pixel and 32 x 32 pixel icon in a single file. IE10 and below users will see the 16 x 16 icon whereas retina Safari users can enjoy the much higher resolution 32 x 32 pixel favicon.
It takes a few extra steps to create retina compatible favicons, below is an adapted version of John Gruber’s “DaringFireball.com: Creating Retina Caliber Favicons” recommendation. This method requires purchasing IconSlate ($5).
Using IconSlate to create a retina favicon (The DaringFireball method)
- Open up IconSlate and create a new project. Only select .ico format, click the arrow next to the ico and check only the 32 and 16 check boxes.
- Name your icon “favicon” (no quotes)
- Highlight the 32 square and paste in your 32 x 32 pixel icon
- Highlight the 16 square and paste in your 32 x 32 pixel icon or if you have a custom 16 x 16 pixel, paste that file into it.
- Click the Build icon (if for some reason the Build icon is greyed out, go to File -> Build
Online HTML + XML generator
Below is a quick online code generator I wrote. It will generate the necessary HTML and XML to use your icons.
- Enter the path to your favorite icons. (if you elected to create a favicon.ico, place that in the root of your domain regardless of your other icons).
- Select a background color for your icon for Windows tiles.
- Scroll down to the code and copy and paste it or download the files.
- Place the XML file in the same directory as your favorite icons.
Web App Manifest
A Web app manifest is a simple JSON file the details how a web app should function when an web app is “installed” (linked within Chrome’s app panel). This JSON file includes declarations for Favicons. For more info, see Web App Manifest
Congrats! You’re done!
A good way to test your new favorite icons is to use a mobile device or mobile simulator and pin your website to your dock/home screen. You should see your new favicon icon on your dock/home screen.
Join in the Fun: Contribute to the github project here: https://github.com/fuzzywalrus/Photoshop-FavIcon-Action