Try it yourself
Four lines from four sites' <head>, each meant to put an icon on the browser tab.
Which one actually does it?
-
This is the one. The modern keyword, understood everywhere. Browsers also look for /favicon.ico automatically, so putting the file at the root covers you even if the tag goes missing.
-
Works, and has for twenty years. "shortcut" is a leftover from Internet Explorer that every browser still tolerates — there is just no reason to write it on a new site.
-
Not a thing. It looks plausible, no browser has ever read it, and nothing anywhere will tell you it did not work.
-
Real and useful, for a different job: the icon when somebody saves your site to a phone home screen. It does not put anything on a tab.
Pick a line. Every one of them has an answer.
Show me the answer
<link rel="icon" href="/favicon.ico">
This is the one. The modern keyword, understood everywhere. Browsers also look for /favicon.ico automatically, so putting the file at the root covers you even if the tag goes missing.
The written version
The small icon on the browser tab →
How to check your own site for this, what to change, and how to confirm it worked.
Now the real thing
Run this check on your own site.
The same check, plus twenty-nine others, against your actual pages. Free, no account, about a minute.