Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When you browse a web site, the "favicon" icon shows up next to the URL (or the bookmark).

If I want that graphic, is there a way to download it directly from the site? I'd prefer to download it directly from the web, but if all else fails, I'll dig it out of wherever it is stored on my computer (Windows 7, Firefox 3.6.6).

share|improve this question

7 Answers 7

up vote 28 down vote accepted

Studiohack has the "thorough" approach but heres a short hack:

  1. Enter the domain name like http://superuser.com/
  2. Add favicon.ico to the end
  3. Press enter (this should be in url: http://superuser.com/favicon.ico
  4. Right click on image and save as
share|improve this answer
    
The other answers are all awesome. I learned a lot, thank you. But, for my specific purposes, this is what I was looking for. Accepted. –  Robert Cartaino Jun 30 '10 at 2:44
    
Well, except for sites like Wikia. –  Hello71 Jul 4 '10 at 22:14
2  
So simple yet genius. –  Raffi Khatchadourian Nov 23 '12 at 19:28

by reading http://en.wikipedia.org/wiki/Favicon you can also find that:

The following format is cross-browser compatible and is supported 
by Internet Explorer, Firefox, Chrome, and Opera.[3]

<link rel="shortcut icon" href="http://www.example.com/myicon.ico" />

Additionally the following is also acceptable:

<link rel="shortcut icon" href="/somepath/myicon.ico" />

The following shows the supported format of link tags, using examples, 
for HTML and XHTML.

HTML:
<link rel="icon" type="image/vnd.microsoft.icon" 
      href="http://example.com/image.ico">
<link rel="icon" type="image/png" href="http://example.com/image.png">
<link rel="icon" type="image/gif" href="http://example.com/image.gif">

so, the common practice is indeed to put a file called 'favicon.ico' on the root folder, but to be sure, you have to lookup the source code of the served file and see if and what is defined there.

eg, for http://superuser.com it is

<link rel="shortcut icon" href="http://sstatic.net/su/favicon.ico"> 
share|improve this answer
    
I have found sites that don't store favicon.ico in the root folder, particularly on Wikia. But the above worked. –  Derrick Coetzee Dec 28 '12 at 18:19

In Firefox 3: Click the favicon, a popup appears, and you can click "more information"...in the window that pops up, go to the "Media" tab. Highlight the specific media item that you want (it shows a preview in the large, white space in the bottom of the window), then click "Save As". Give it a name, pick a location, and you're done! :)

Some sites may not have a favicon listed, but some will...hit or miss...try this on Super User...SU has a favicon listed...

share|improve this answer
1  
This works the same in Firefox latest (ver 21) however, if the favicon is in the root of the site ala the IE default, it won't show up as media there! Because it is not specified directly in the HTML, it's implied. –  Jeff Atwood May 31 '13 at 18:58

You can't always add /favicon.ico (eg. http://superuser.com/favicon.ico)
All of the answers are more complicated than necessary.

All you do is what is written here: http://www.itechcolumn.com/2012/03/simplest-way-to-download-favicon-from.html

  1. Go to the target site.
  2. View the page source (Right click on the page and click on "View Page source") - using firefox, may be slightly different in other browsers.
  3. Search (Ctrl+F) for "shortcut icon"
  4. You should see something like this:

    link rel="shortcut icon" href="http://www.sitename.com/images/thenameofthefavicon.ico"/>

  5. Right click on the link http://www.sitename.com/images/favicon.ico and save the icon. Or, open the page using the URL and save the page.

share|improve this answer
    
good advice! But not all sites specify it directly in the HTML, it can be inferred.. –  Jeff Atwood May 31 '13 at 18:59

Try this bit of PHP which grabs the favicon and saves it as an .ico file. You could probably use this to grab almost any file. Note the use of the 'b' for 'binary' flag.

<?php
    echo '<p>Fetching Favicon.ico.</p>';
    $in = fopen('http://targetdomain.com/favicon.ico', 'rb');
    $contents = '';
    while (!feof($in)) {
        $contents .= fread($in, 8192);
        }
    fclose($in);
    $len = strlen($contents);
    echo '<p>Read ' . $len . ' bytes.</p>';

    $out = fopen('favicon.ico', 'wb');
    fwrite($out, $contents, $len);
    fclose($out);
    echo '<p>Written Favicon.ico.</p>';
?>
share|improve this answer

No need for all that PHP crap.

All you need to do in Firefox is click the ico image in the URL, click "More Information", then click the "Media" button. Favicon.ico is usually the first one in the list and already highlighted, but if it isn't, scroll down and then click the "Save As" button.

By the way, since Firefox 16, ico images don't display in the URL field anymore, but do in each tab and can be grabbed in the same way.

share|improve this answer

If you have JavaScript enabled, you could run this in the console :

(function() {
    var i=0;
    var arrLink = [];
    var found = 0;
    arrLink = document.getElementsByTagName('link');
    if (arrLink.length > 0) {
        for (i=0; i < arrLink.length; i++) {
            if (typeof arrLink[i].rel !== 'undefined' && arrLink[i].rel.indexOf('icon') > -1) {
                found = 1;
                window.open(arrLink[i].href);
            }
        }
        if (found === 0) {
            alert('favico Not Found');
        }
    } else {
        alert('favico Not Found');
    }
})();

Alternatively use the below code as a bookmark / paste in the URL :

javascript:(function(){var a=0,b=[],c=0,b=document.getElementsByTagName("link");if(0<b.length){for(a=0;a<b.length;a++)"undefined"!==typeof b[a].rel&&-1<b[a].rel.indexOf("icon")&&(c=1,window.open(b[a].href));0===c&&alert("favico Not Found")}else alert("favico Not Found")})();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.