DEV Community

Discussion on: Definitive edition of "How to Favicon" in 2023

 
xcuses profile image
xcuses • Edited

Yes there are reasons why I chose 48x48:

  • afaik, some versions of the Chrome browser used to pick the most appropriate size. If the browser tab needs 32x32 (which is likely), depending on the device and Chrome version, the browser might pick a 32 ico instead of the svg
  • at the time of writing the suggested code, with an ico size of 16 or 32, my Chrome sometimes loaded both the ICO and SVG, or just the ICO. In the newest version on my desktop (114.0.5735.134), this doesn't happen with a size of 16 or 32 any more. Haven't checked on Android this time.
  • last not least, afaik, Google uses the .ico for the web search results, so a bigger .ico might scale better
Thread Thread
 
darrylnoakes profile image
Darryl Noakes

As a note, I am using 48x48 in my project.

Thread Thread
 
masakudamatsu profile image
Masa Kudamatsu

Hi @darrylnoakes and @xcuses ! Thanks a lot for your contributions. I'm currently rewriting the article to reflect what you have discovered. Writing forces me to think hard about the reason behind the HTML code, and now I'm not very sure why we need sizes="any" for the SVG favicon. Darryl's test suggests it doesn't really matter (at least for now) whether SVG favicon has sizes="any" or not. So is it for making the HTML code future-proof? Why would the SVG favicon without sizes="any" not be chosen if Chromium browsers strictly followed the expected logic?

Thread Thread
 
page200 profile image
page200 • Edited

@darrylnoakes

I'm not sure what exactly Google uses to pick an icon for Google Search results, but the minimum is 48x48.

Google's article "Define a favicon to show in search results" says "While the minimum size requirement is 8x8px, we recommend using a favicon that's larger than 48x48px".

Old versions of Google Search used to recommend using any multiple of 48, including 48.

I don't know how anyone could check, other than talking to someone rather directly involved with Search.

Make a website whose favicon variants (SVG, the different sizes in the ICO file, etc.) look visibly different, maybe also include some unique text on the page to find the page easily on Google Search, publish the link on websites that Google visits often or ask Google to index your page, and check what favicon ends up on Google Search.

In the favicons, ideally also include an identifier of the setup (combination of HTML code and favicon.ico sizes) that you're testing.

A general recommendation not only for this experiment: You can change the favicon contents, but don't change their URL frequently.