Skip to main content
veerareddyc1015
Level 3
Jul 10, 2026 3:06 PM UTC
Question

favicon.png image is not loading in modern browsers

Hi Team,

I am facing an issue with favicon loading.

Previously, I only had the following code in my application, and it worked as expected:

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>

As part of an update, I wanted to use a favicon.png file since most modern browsers support PNG favicons. I replaced the ICO file with the following, and it worked correctly:

<link rel="shortcut icon" type="image/png" href="favicon.png"/>

However, for backward compatibility with older browsers, I included both the PNG and ICO files:

<link rel="shortcut icon" type="image/png" href="favicon.png"/>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>

I expected modern browsers to load favicon.png and use favicon.ico only as a fallback for browsers that do not support PNG favicons. Instead, the browser always loads favicon.ico, and the PNG file is ignored.

Is this the expected behavior? If both favicon types are specified, should the browser always prefer the ICO file, or should it use the PNG file when supported?

To reproduce the issue, use different images for favicon.png and favicon.ico so it is easy to identify which favicon the browser is displaying.

Thanks in Advance,


Regards

Veera

    2 replies

    lavishvasuja
    Level 4
    Jul 12, 2026 6:23 AM UTC

    ​@veerareddyc1015 -

    This is expected browser behavior.

    Favicons don't follow a MIME type–based fallback mechanism, and the selection logic is browser-specific. When multiple rel="icon" or rel="shortcut icon" entries are present, browsers don't necessarily treat them as a primary/fallback pair. As a result, the PNG favicon isn't guaranteed to be used, even if the browser supports PNG favicons.

    If legacy browser support isn't required, the simplest approach is to use only the PNG favicon:

    <link rel="icon" type="image/png" href="favicon.png">

    If legacy browser support is required, you can include both PNG and ICO icons. However, it's best not to rely on the ICO acting as a fallback, as favicon selection behavior varies and isn't guaranteed across browsers.

    Translate
    Shashi_Mulugu
    Community Advisor and User Group Leader
    Community Advisor and User Group Leader
    Jul 17, 2026 1:42 AM UTC

    Hi ​@veerareddyc1015 ,

     

    I think its order problem,  declare as below and it should work

     

    <!-- 1. Loaded first (Fallback for old browsers) -->

    <link rel="shortcut icon" href="/favicon.ico" sizes="32x32">

     

    <!-- 2. Loaded second (Overwrites the ICO rule in modern browsers) -->

    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">

     

    Translate