[html] Correct MIME Type for favicon.ico?

According to the Internet Assigned Numbers Authority (IANA), all .ico file falls under the MIME type image/vnd.microsoft.icon. (Source)

E.g. <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" />

However, savvy internet guru, Paul Irish, claims this is wrong, and that it would actually be image/x-icon. (Source)

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

I know you can get away with not including a "type" for .ico files, but if you were going to include one, which should it be? Are there actually any problems with serving it as official IANA type?

This question is related to html browser mime-types favicon

The answer is


I think the root for this confusion is well explained in this wikipedia article.

While the IANA-registered MIME type for ICO files is image/vnd.microsoft.icon, it was submitted to IANA in 2003 by a third party and is not recognised by Microsoft software, which uses image/x-icon instead.

If even the inventor of the ICO format does not use the official MIME type, I will use image/x-icon, too.


I have noticed that when using type="image/vnd.microsoft.icon", the favicon fails to appear when the browser is not connected to the internet. But type="image/x-icon" works whether the browser can connect to the internet, or not. When developing, at times I am not connected to the internet.


Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to browser

How to force reloading a page when using browser back button? How do we download a blob url video How to prevent a browser from storing passwords How to Identify Microsoft Edge browser via CSS? Edit and replay XHR chrome/firefox etc? Communication between tabs or windows How do I render a Word document (.doc, .docx) in the browser using JavaScript? "Proxy server connection failed" in google chrome Chrome - ERR_CACHE_MISS How to check View Source in Mobile Browsers (Both Android && Feature Phone)

Examples related to mime-types

Stylesheet not loaded because of MIME-type Is the MIME type 'image/jpg' the same as 'image/jpeg'? Proper MIME type for .woff2 fonts How to check file MIME type with javascript before upload? Correct MIME Type for favicon.ico? Right mime type for SVG images with fonts embedded Which mime type should I use for mp3 Correct mime type for .mp4 What does "Content-type: application/json; charset=utf-8" really mean? Add MIME mapping in web.config for IIS Express

Examples related to favicon

Add Favicon with React and Webpack What is the best practice for creating a favicon on a web site? HTML 5 Favicon - Support? How can I get a favicon to show up in my django app? How to set-up a favicon? Favicon not showing up in Google Chrome Add image in title bar How to set custom favicon in Express? Why does my favicon not show up? Correct MIME Type for favicon.ico?