229
This question already has answers here:
Closed4 years ago.

The community reviewed whether to reopen this question4 years ago and left it closed:

Opinion-based Because this question may lead to opinionated discussion, debate, and answers, it has been closed. You mayedit the question if you feel you can improve it so that it requires answers that include facts and citations or a detailed explanation of the proposed solution. If edited, the question will be reviewed and might be reopened.

What favicon dimensions, file formats and meta/link tags should be used as of 2022? This includes apple icon, windows, android and other devices people use today.

I use Opera and I can see it supports svg format. Is it the best solution to use svg nowadays? Is there any option "one file fits all"?

I've been browsing many websites and checked different "favicon generators". All of them are years old and work mostly with png files.

For example:What code should be used for ico and svg?

<link rel="icon" href="favicon.ico" type="image/ico"><link rel="icon" href="favicon.svg" type="image/svg+xml">

or should dimensions be specified if ico contains more sizes? I didn't find one good answer.

<link rel="icon" sizes="16x16 24x24 32x32 48x48 64x64" href="favicon.ico">

Please provide dimensions, file formats and meta/link tags of what favicons should be used.

askedFeb 23, 2018 at 21:27
Jakub Muda's user avatar
7
  • 14
    realfavicongenerator.net is updated regularly (realfavicongenerator.net/change_log)CommentedFeb 24, 2018 at 2:57
  • favicon.proCommentedSep 29, 2018 at 19:42
  • 25
    Personally I would only useone large PNG image: in 2019 all modern browsers support PNG and can resize that. We should absolutely stop this crazy proliferation of favicons and boycott browsers that don't comply with the standard. In the future also a single SVG image would be ok, but at the moment it is not widely supported.CommentedOct 20, 2019 at 10:48
  • 3
    Does this answer your question?What is the best practice for creating a favicon on a web site?CommentedAug 3, 2021 at 14:11
  • 1
    Actually it does.CommentedAug 17, 2021 at 15:04

3 Answers3

348

Disclaimer: I'm the author of RealFaviconGenerator, which I expect to be up-to-date (mostly, see below). So don't be surprised if this answer matches what RFG generates.

The one-size-fits-all myth

There is no "one size fits all" icon. You can't create a single SVG icon and expect it to work everywhere.

From a technical point of view, a single SVG icon would be a good thing. But from a UI and UX point of view, this is not a desirable outcome. Compare iOS and Android. On iOS, all home screen icons are squares with rounded corners (iOS fills transparent regions of Touch icons with black). On Android, home screen icons often use non-square shapes and transparency (including Google app icons). Submit a single touch icon and Android Chrome will use it. But you won't be able to matchAndroid icon guidelines, whereas a dedicated icon could.

So I advice to deliberately avoid using a single icon. Rather target each platform individually, when possible (this is not always the case).

Icons, platform per platform

iOS Safari

iOS Safari expects atouch icon. As of today, this is a 180x180 PNG image. This image should not use transparency and its corners will be automatically rounded when added to home screen. Declared with:

<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">

Over the years, this icon has become the "default high resolution icon" for many browsers. So you will find it elsewhere, when adding to bookmark, etc.

Android Chrome

Android Chrome relies on theWeb App Manifest. Although this manifest is not dedicated to Android Chrome, it is currently its main supporter. So at the moment, it is still quite safe to consider the icons from the Web App Manifest to be for Android Chrome.

As the name suggests, the Web App Manifest is for, well, web apps. But any web site can use it as a way to reference some icons.

Android expects a 192x192 PNG icon, transparency allowed and encouraged.

The manifest is declared with:

<link rel="manifest" href="/icons/site.webmanifest">

Edge and IE 12

Microsoft introduced thebrowserconfig, an XML document which lists various icons that fit the Metro UI.

The file andbackground color are declared with:

<meta name="msapplication-TileColor" content="#da532c"><meta name="msapplication-config" content="/icons/browserconfig.xml">

Classic desktop browsers

Windows/macOS Chrome, Windows/macOS Firefox, Safari, IE... This is were things are a little more blurry. Historically, there was a singlefavicon.ico file, still supported. However, most recent browsers rather pick PNG icons, which are lighter. Plus some browsers are not able to select the proper icon in the ICO file (this format can embed several versions of an icon), leading a low resolution icon being wrongly used.

One could be tempted to drop the oldfavicon.ico entirely. Although I would like to make this leap in RFG, I didn't run the necessary tests to evaluate the impact on the old browsers.

Thus the combo I still recommend today, withfavicon.ico embedding 16x16, 32x32 and 48x48 icons:

<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png"><link rel="shortcut icon" href="/icons/favicon.ico">

Other browsers

Other browsers may have dedicated icons. For exampleCoast by Opera is looking for a 228x228 icon. The need to focus on these browsers is not obvious. They usually use the touch icon or other icons when they cannot find "their" icon.

Conclusion

As announced at the beginning, this is exactly whatRealFaviconGenerator creates.

Leonid Shevtsov's user avatar
Leonid Shevtsov
14.3k9 gold badges56 silver badges86 bronze badges
answeredFeb 25, 2018 at 0:28
philippe_b's user avatar
Sign up to request clarification or add additional context in comments.

24 Comments

@Will No recent change. This is because of a twist: if you place your icons in the root directory (eg./favicon.ico), IE will find it by convention. Thus, no declaration in this particular case. Generate a favicon again with/path/to/icons as the path and this time the declaration will be present.
msapplication-config, msapplication-TileColor, browserconfig are obsolete. Everything is moving towards manifest.json and PWAs.
@RobertBaker That's right. It's still under dev so for now browserconfig is still the way to go.
people like you don't get the love they deserve. I'm here to give you a wet, sloppy, grandmother with too much lipstick kiss on your forehead. Used your generator, a charm me good man, a charm. S.O. police be damned, i'm saying thanks!
This answer badly needs an update since your own site now has an SVG generator that generates a package containing only an SVG and a PNG. Is this the new recommended way?
|
47

I had the exact same question a few weeks back. It is surprisingly hard to find reliable up-to-date information about favicons on the internet. In factMDN andW3C both link to Wikipedia for more info about favicons. The Wikipedia article, however, is quite short and not very helpful. It took me several hours to research what the optimal icons for modern browsers are.

This is what I learnt:

There is no "one file to rule them all" solution. However, for modern browsers, it is actually not that much you need.

  1. The standard favicon size in browsers is still 16x16 points corresponding to 32x32 pixels on high resolution screens.
  2. There is no need to still include afavicon.ico file in your root directory unless you want to supportIE 10 or older.
  3. SVG would be nice, but is not supported by all browsers. So the easiest solution is still to justuse PNG images.
  4. Google explicitly saysthey don't support 16x16 or 32x32 icons. For Google results, you need to include at least one icon that is a multiple of 48x48.
  5. For when users pin your website on their phone's launch screen you need a 192x192 icon for Android, 167x167 for iPad and 180x180 for iPhone (while thelink tags for iPhone are special — see below)
  6. In theory, you could provide a single 192x192 (or higher multiple of 48) icon which would be scaled down by browsers and all other services, but especially for the 16x16 point version, these scaling results will probably be worse than what you get when you scale it yourself with a professional image editor or even provide special versions for these low resolution icons.
  7. You can also add aweb manifest file that includes more meta info like theme colors. But that isonly supported on Android and brings little benefit unless you really expect a large share of your users to pin your website on their home screen (in my humble opinion that is very unlikely for most websites).

My recommendation would be to use the following in your header:

<!-- For all browsers --><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"><!-- For Google and 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"><!-- 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">

I have also written ablog post with a bit more prose and more background information.

Peter O.'s user avatar
Peter O.
33.1k14 gold badges86 silver badges97 bronze badges
answeredJun 30, 2021 at 6:40
codingFriend1's user avatar

2 Comments

I believe that some RSS readers will only look in your root for a favicon.ico, they will not bother to look elsewhere, in which case your second point is incorrect.
@BLoB That's a good point. For compatibility with apps and services that are not major browsers, you might want to keep thefavicon.ico file in root as a fallback.
24

It is also worth mentioning that together with favicon some other tags should be added like OG tags, Twitter cards or MS-application. It all serves the same purpose - visual identification of your brand and should also be included.

Twitter card can be foundHERE

I add following tags

<meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@YourAccount"><meta name="twitter:creator" content="@YourAccount"><meta name="twitter:title" content="Title of your page"><meta name="twitter:url" content="URL of your page"><meta name="twitter:description" content="Your description here"><meta name="twitter:image:src" content="URL of image">

I found that many users make images 1300px by 650px and jpg/png formats.

After adding all tags they should be validatedHERE


Facebook OG has more option but general are as follows:

<meta property="og:title" content="ENTER PAGE TITLE"><meta property="og:type" content="website"><!--Different values possible --><meta property="og:url" content="ENTER PAGE URL"><meta property="og:image" content="URL OF IMAGE"><meta property="og:image:width" content="1240"><meta property="og:image:height" content="650"><meta property="og:site_name" content="ENTER YOUR SITE NAME"><meta property="og:description" content="ENTER YOUR PAGE DESCRIPTION"><meta property="fb:app_id" content="ENTER YOUR FB APP ID"><meta property="og:see_also" content="URL to recommended page number 1"><meta property="og:see_also" content="URL to recommended page number 2"><!--UP TO 5 WEBSITE ADRESSES -->

Facebook recommend specific ratio of the image and the file size is limited to 8Mb. To keep similar images with twitter card I recommend dimensions 1240px by 650px and jpg/png format. Facebook and twitter do not accept svg...


I found that some global brands use this tag on their websites. One had dimensions 150x150 pixels and png format. This image may be used by browsers to display in search results.

<meta name="thumbnail" content="path/to/image/thumb-150x150.png">

Real Favicon Generator covers also Microsoft favicons. There are many other meta tags for MS-application to optimize bow the page and other infos such as image are displayed. This topic is also worth reading.

I hope this is usefull for someone and expands the topic of branding your website.

answeredMar 24, 2018 at 1:31
Jakub Muda's user avatar

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.