Nov
13

How To Create A Favicon

Filed under: Uncategorized | Tags: | November 13th, 2003
Post

I’m going to make a confession: I can’t stand favicons. To clarify, I love the idea and the little icons on my Mozilla tabs are nifty, but I hate having to make them. This is partially due to working within the constraints of 16 by 16 pixels, but more so that until now I haven’t found a good way to generate said icons on Windows. I was jealous as a whip (can a whip be jealous?) when Noel posted instructions detailing how to do it on a Mac. For aforementioned reasons they weren’t applicable to me, so I set out to find a clean way to do this on Windows without spending any moolah.

At this point someone is probably wondering what in the world a favicon is. As far as I know, it’s not a standard of any kind (and if it was it’d be a badly implemented one) but it’s a widely supported feature in modern browsers that allows a site to specify a small graphic or icon to go next to its address in the address bar and theoretically as the icon for the page when it is bookmarked as well. (Some examples of favicons.) I believe Internet Explorer was the first to implement this. Due to popular demand there is a new photomatt.net favicon (you may need to reload that link directly to see it). To see it in Internet Explorer, bookmark this site (which you should do anyway). In Mozilla and its progeny you should see it just fine automatically, and possibly in Safari though I don’t have that handy to test. To see it in IE for Mac you need to sacrifice an Intel CPU and do a favicon dance. Actually I’m not sure why IE5/Mac has trouble with some favicons, at some point in the past I tracked it down to MIME issues, but it’s not really worth the effort anymore.

Another good reason to have a favicon.ico in the root of your site is some browsers request that file whether it is linked in your HTML or not, so if there’s nothing there it fills up your error logs. Since I watch error logs pretty closely this has always been an annoyance for me.

So what’s the trick to creating lightweight multi-size favicons? I used to use the online java tool the folks at favicon.com offered, but now they seem more concerned with making money than providing free tools. More recently I’ve used Icon Forge which I can easily say is one of the most awful programs I have ever used in my life. Truly horrid. I wouldn’t recommend anyone do that, so here’s the process I came up with. (Any excuse to use a nested list.)

  1. Download png2ico, which is a small, free utility for Windows, Linux, et cetera that works quite well. Extract it to c:/.
  2. Create an image you’d like to use at a decent size (at least 32×32 pixels) in your favorite image editor. I like Photoshop so here’s what I did there:
    1. Ctrl + N to start a new document. Choose 32×32 pixels for the size. Cram whatever you want to use in there, I choose a comic Josh did of me a while ago.
    2. Do a Save for Web (Ctrl + Alt + Shift + S) and save it as a PNG with the filename icon-32.png to the same folder as the program you just downloaded (to keep things simple). If you want to keep the size down I would recommend taking it down to 16 colors. Don’t forget transparency if you need it.
    3. Now go back and resize the image you’re working on to 16×16 pixels (Tools → Image Size [is there a shortcut for that?])
    4. Save this image as a PNG with the filename icon-16.png in the same directory as the above.
  3. Now it gets a little tricky, open up the command line. Try Start → Programs → Accessories → Command Prompt.
  4. Navigate to the folder where the png2ico.exe file is, if you followed the directions above you can use the command cd \png2ico.
  5. Now you just have to enter a command to roll those two PNG files you made into one nice ICO file. Here you go: png2ico.exe favicon.ico --colors 16 icon-32.png icon-16.png . You may be able to use command line completion (pressing a letter or two and then tab) to fill some of that in for you. You could potentially embed 64×64 and 128×128 pixel sizes into the icon file by just specifying additional PNGs of that size, but for a web favicon that really isn’t needed. Just remember this if you ever want to make a nice application icon. For an applicatoin icon you’d probably want to use a PNG-24 with full alpha transparency, which this tool supports as well.
  6. Now there should be an favicon.ico file in that same folder which you should upload to the root of your site and then link to it with something like <link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
  7. Have a drink.

Now I know that sounds like a tricky process, but it’s actually not as hard as it may read and of course if you have any problems leave a comment and I’ll try to help you. There is supposedly a graphical front-end for using png2ico but it was so badly designed it’s actually easier to use the command line, as unlikely as that seems.

Update: Ian has found my favicon twin. Where have you been all my life?

Update 2: Oskar van Rijswijk recommends IrfanView in the comments. You might want to give that a try too.

90 Responses

Pingback: ICTlogy

Kymberlie R. McGuire | November 13th, 2003 @ 10:26 am

I have one on Neurotic Fishbowl and I Wish, You Wish, but they only show up sporadically.

Matt | November 13th, 2003 @ 11:29 am

Kymberlie, yours has always been one of my favorites to see in my tab bar.

Oskar van Rijswijk | November 13th, 2003 @ 4:34 pm

I used IrfanView [ http://www.irfanview.com ] to make a favicon. It is freeware. You can change almost any graphical format to 16×16 … and then just save it as an icon (*.ico file). Easy!

e | November 13th, 2003 @ 5:34 pm

your new favicon doesn’t load for me! it’s still old PM.

Matt | November 13th, 2003 @ 6:46 pm

You might need to load it directly and do a force reload to trick your browser into grabbing the new one.

e | November 14th, 2003 @ 6:48 am

sadly, clicking the link you have provided actually downloads the old one. but i can see what it looks like by going to that site that talks about your favicon twin, so i know what it looks like. if only it would load, though!

Lars Holst | November 14th, 2003 @ 9:02 am

you will need to empty the browser cache.

Mike | November 15th, 2003 @ 6:29 am

Glad to see you got around to the change. I echo Oskar’s comment about using Irfanview.

Eric | November 18th, 2003 @ 1:37 pm

I used it and it worked great, thanks for the article.

Lauren | November 18th, 2003 @ 2:30 pm

I have been trying to figure out to do this for over a month. I didn’t even know what these things were called (learned a new word today: “favicon”) so I couldn’t even Google it. Thanks to Zeldman for linking to your site. And thank YOU for posting instructions!!

Anonymous | November 18th, 2003 @ 4:12 pm

Caught this from Zeldman’s post on favicons… Ethan’s favicon seems like a copy of my pixelart work I did for deviantART back in 2001 =(

http://www.deviantart.com/view/119806/

michael | November 18th, 2003 @ 4:55 pm

While not necessarily free, I’ve found microangelo to be a useful program.

mmkay | November 18th, 2003 @ 5:55 pm

This certainly used to work, and it probably still does.

Create a 16×16 .bmp file of the image you want. Rename it favicon.ico. Upload it.

Easy as a whip.

bronwen | November 19th, 2003 @ 8:47 am

I’ve been using a really good freeware app (with a GUI): “QTam Bitmap to Icon version 2.5.10″

http://www.qtam-computer.com/bmp2ico25.shtml

Gordon | November 19th, 2003 @ 10:45 am

I’ve been using theh bmp to ico route as well… seemed to work for me, although I always have hassles getting favicons to appear in IE…

AdrianG | November 19th, 2003 @ 11:16 am

Irfan view is good and also the HTML Kit website (chami.com) has a page with a Favicon gerator on it - you can post a gif or jpeg image and back comes your favicon.

Charles | November 19th, 2003 @ 1:02 pm

I found a great icon editor for Windows the other day. It does pretty much everything you’d expect of a simple icon editor, plus a few more things besides. Best of all, it’s free! http://www.snidesoft.com/

Eric | November 19th, 2003 @ 8:55 pm

When I feel like making one, I go with @Icon suschi http://towofu.s5.xrea.com/soft/e-index.html#features

josh | November 19th, 2003 @ 11:11 pm

(Tools → Image Size [is there a shortcut for that?])

It took me like 3 years to discover it, but right-clicking on the image’s titlebar gives you a very handy mini-menu of image/canvas commands. And now I use it every day.

Phillip | November 21st, 2003 @ 1:05 am

The correct type is not image/ico but image/x-icon

x- types are unregistered with IANA. See ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/image/
Also see Apache’s mime.types: http://lxr.webperf.org/source.cgi/docs/conf/mime.types#482

Wilson | November 22nd, 2003 @ 1:32 am

(Tools → Image Size [is there a shortcut for that?])

I don’t know which version of Photoshop you’re using, but mine (7.0) doesn’t have a “Tools” menu.
Anyway, I’ve been using Alt-I, I for quite a long time to get to the image resize dialog quickly. You might wanna try it.

Matt | December 10th, 2003 @ 4:33 pm

“…open up the command line. Try Start → Programs → Accessories → Command Prompt.”

no such thing… i mean, I go to Start, then Programs, then Accessories, but there is no Command Prompt. Am I missing something?

Darren | December 12th, 2003 @ 8:11 am

>>I used to use the online java tool the folks at favicon.com offered,
Hi, just to say that the folks at http://www.favicon.co.uk still have the online Java tool for making favicons…

Koby | December 14th, 2003 @ 4:42 am

I was trying to figure out how to make a favicon, and downloaded the png2ico, but I don’t have the g++ compiler. I didn’t feel like downloading g++, so I looked around and discovered that I could use “convert -c icon6.png -o favicon.ico” to make an transparent ico file.

Matt | December 14th, 2003 @ 1:28 pm

Koby, they also have binaries on the download page.

Michael Pierce | December 18th, 2003 @ 10:46 am

Thanks for the instructions, I now have a meager favicon.ico for my pages! :)

Of course, now that I’ve done it by hand, I found a free tool online. Looks like the folks at HTMLKit are picking up the slack from favicon.com. Their tool will take any graphic file of any resolution and create a favicon.ico for you.

Give it a try: http://www.chami.com/html-kit/services/favicon/

Kylie | January 5th, 2004 @ 8:19 pm

On what page do you link to the favicon or is it on all pages?

Skip | January 11th, 2004 @ 5:02 pm

It seems odd. I have been to a few sites that have a favicon show up.
However, I have been to numerous site that espouse knowledge of
favicons but none showing there own in the url window….?

Skip | January 11th, 2004 @ 5:58 pm

Ah yours appeared. Why is it some favicons show up in favorites after being
booked marked but not in their url window, while on other sites they show up in
both places.

Jacquie | January 14th, 2004 @ 9:53 pm

Yes - how do you link the icon image in your web pages - is it just on the homepage where you do that? I am trying to figure out how to use Microangelo, myself. Has anybody out there had any luck with that?

Jacquie | January 14th, 2004 @ 11:20 pm

Another post by me - but I just tried out the HTML kit - http://www.chami.com link, mentioned in the comment by Michael Pierce, above, and that worked - very quick and easy, it created the icon from a .gif image that I uploaded, then returned it to me in a zip file, presto! They even tell you where to put the link in your HTML page - it only has to go on your index page, in between the tags.

I would love to know how to create the icon myself, using the Microangelo software which I actually downloaded, but still can’t figure out how to use from: http://www.impactsoft.com/muangelo/muangelo.html

If anyone out there knows how to do it with that, maybe they could post the info?

Anonymous | January 15th, 2004 @ 5:04 am

Something else to consider. If you create a 32×32 icon, it’ll keep it’s quality if a user drags the favorite to his/her desktop. The browser will resize it automatically to 16×16 for the browser window and favorites. But if you start with a 16×16 image, and the user puts it on their desktop (something I do quite often) it “blurs” to the point of ugly.

If you want to see an example I’ve set the favicon on this page to 16×16
http://cloneclubs.com/giveaway.shtml

and this page
http://cloneclubs.com/screensaver.shtml
to the 32×32.

Both look about the same in the browser address bar, but once you drag it to the desktop, the 32×32 is clearly better.

Something to consider.

J. | January 15th, 2004 @ 3:11 pm

Well - I was under the impression, or had read that the favicon would only work if it were 16 X 16, but I understand what you mean by the quality - when I created mine with the generator, I uploaded a 48 X 48, and it returned one that looks fine in the browser bar, but haven’t tried to drag it to desktop yet. I didn’t know that you could upload a 32 pixel size, though… will give that a try.

Here’s another question: does it have to be named: favicon.ico, or can you give it another name, with the .ico extension?

Daniel | February 11th, 2004 @ 11:40 pm

I have a long-running website which is currently under construction. We do a lot of programming which are downloadable on our site, and therefore we have to deal with icons. I have tried using Icon Forge and have the same opinion you do about it. I highly recommend ‘Axialis IconWorkshop 5′ - it is fantastic!
Gove it a try and tell me what you think.

Sharon Iversen | February 25th, 2004 @ 1:37 am

You Rock My World. Stumbled across your site…thank the GODS for that. Thanx for the “understandable” step by step solutions to creating a Favicon!

Jon Wright | February 27th, 2004 @ 5:26 am

Nice resource. Yes those little icon applications are so irritating; it’s best to use the app you’re familiar with. BTW, love the design, I think that cool green background might ‘inspire’ an upgrade to one of my sites…

mikey | March 9th, 2004 @ 11:29 pm

I cant seem to get the damn thing to work :-( Thanks anyway!

Mike | March 21st, 2004 @ 8:57 am

Worked great for me, thank you. Someone asked, I can’t find Start → Programs → Accessories → Command Prompt. Answer, just go to Start > Run, and type the word command and press OK. That’s it. I am having a problem forceing the new favicon icon as my old keeps showing. I linked directly to it from a page. still viewing old. Deleted cache and temp

cal | March 31st, 2004 @ 4:58 pm

where abouts do i put the “”" “”" coding?

Toby | April 5th, 2004 @ 4:08 am

Hi, Using Photoshop you can save correct ICO files with my free plugin: download from here.

Joost | April 26th, 2004 @ 7:58 am

Hi!
Is it possible to make a kind of icon that you can see in the address bar without putting them in the favorits?

Chi Huynh | May 11th, 2004 @ 4:06 pm

Thanks Toby for the Photoshop plug-in link.

I’m curious though, once the favicon has been set say for your homepage, it doesn’t stay in the URL address bar once u head off to another page on your site, say about us page.

Any way of making the favicon stay on the URL address bar thorough your site??

Thanks for the help.

Cheers.

david | May 14th, 2004 @ 4:58 pm

For Mac users: Safari 1.2.1 stores favicons in a separate cache. You cannot simply choose ‘empty cache’ from the menu. If you’ve made a new icon for your site and want to see it, you must empty the icon cache separately. Download the Safari Icon Manager (freeware) to empty the icon cache.

Jeff Clark | June 6th, 2004 @ 11:50 pm

Sweeeeet - it worked!

I used png2ico on Linux FC2 and it worked right the first time! Bling bling

Stacy | June 7th, 2004 @ 12:02 pm

That was so simple! Thanks!

germanboy's ramblings » Yep … definitely bored | June 15th, 2004 @ 4:28 pm

[...] [...]

lantere | June 27th, 2004 @ 4:05 pm

Opera 7 displays the favicons without any problems. Internet Explorer refuses to display it, no matter what I do. Deepnet Explorer only displays certain favicons. Lucky for me, I don’t use IE anymore :-)

Ben | July 5th, 2004 @ 2:49 am

I just saved the picture as favicon.ico and it worked fine. Did I miss out on something by not using the program you suggested?

Pingback: WebDesignBlog

Christian Ottosson | August 7th, 2004 @ 4:09 am

Please note that the correct mimetype is image/vnd.microsoft.icon.

Anonymous | August 11th, 2004 @ 4:50 pm

Thanks for this information!

danithew | August 14th, 2004 @ 2:11 pm

I just figured out what the heck a favicon was and did a google-search on the term. I can’t tell you how pleased I was to see a link to your blog with an article on “How to Create A Favicon.” I should have known all along that you’d provide me with the instructions I’d need on this. Rock on Matt! :)

Debbie Churchill | August 25th, 2004 @ 10:37 am

So, you guys are going to all this trouble to create these little beauties, but whenever I add a website to my Favorites (IE 6.0), they disappear after a couple of days to be replaced by the Internet Explorer ‘e’ icon. Is there something I can do to make them stick?

Matt | August 25th, 2004 @ 10:40 am

Nope that’s a bug with internet explorer.

John | August 29th, 2004 @ 11:30 am

The favicons disappear from IE Favorites — to fix this use the FavOrg program to make them persistent. For simple favicons the GoldIcon program works well and is simple to use.

BobC | September 1st, 2004 @ 5:47 pm

Yeah, I have Opera 7 and MSIE6 and IE refuses to display any favicons at all. As ‘lantere’ had the same problem above it must be something to do with the way these programs work together. Unfortunately, this little feature doesn’t make testing any easier.

lisa | September 28th, 2004 @ 10:09 pm

Hello, I just wanted to tell you thank you. I didn’t get the progam to work, but i used a free trial version converter and follow your advice. Thanks agian,
Lisa

hendrik jan | November 10th, 2004 @ 1:04 pm

Is it correct that favicon only work (under IE) if the page does not allows framing (in the address bar)
Thanks for advice

Hendrik Jan

Lewis Henshall | November 28th, 2004 @ 9:48 am

Fantastic. Thank you.

Lewis Henshall | November 28th, 2004 @ 10:11 am

Using MS-DOS Prompt on Windows ME, I had to provide the full address to the files for it to work. And work it did.

:-)

Zman | December 2nd, 2004 @ 4:57 am

Does the icon have to be a .ico file? I used a gif, and it works great, but it won’t stay. Everytime I navigate to a different area on my page, the icon disappears.

http://bluetongueskinks.net

Himanshu | December 7th, 2004 @ 5:33 am

Thanks guys! Its just wonderful application. And to top it all very easy to operate.

Pingback: noscope | Favatars

Pingback: { chase southard }

Robert Walker | January 23rd, 2005 @ 11:32 am

I have tried to upload the favicon to my root directory on http://www.fuzzylogik.co.uk but the file still does not appear in the browser. I also tried to include it and link from my img file but still no joy. Im not sure if the code i have is correct either:

Is this the correct code? :O)

Navin | February 14th, 2005 @ 1:38 am

Thanks for the info on how to make a favicon - I now have one on my site!

BTW, I used the gimp to make the image, and it actually has a “.ico” option in the “save as” menu.

Cheers,
Navin

Pingback: CrypticScriber

stewart | March 3rd, 2005 @ 4:01 am

i just used: http://www.html-kit.com/e/favicon.cgi

its free, online, easy and instant!

Logan | March 31st, 2005 @ 10:08 pm

Thanks, Matt! Displaying of favicons in the tabs in Firefox seems to be kind of touch-and-go, but hey, I’ll take what I can get. Thanks for the help.

Mathias Bynens | May 22nd, 2005 @ 3:13 am

Another favicon twin of yours?

Chris | July 14th, 2005 @ 6:21 am

Thanks for the instructions, Matt. It worked like a champ!

Andrei | February 27th, 2006 @ 6:38 pm

Firefox does favicons just as bad as IE. Like, right now, I’m not seeing shit for this site. Sometimes I see it, sometimes I don’t.

I swear, I think Opera is the ONLY browser on this planet that handles favicons correctly.

Richard | March 15th, 2006 @ 3:35 am

I am using IE 6.0, and after 3 to 4 days all my favicons in “favorites” disappear. What I have been doing is deleting them and re-bookmarking them. Any ideas on how to stop them from disappering in the first place?

Richard | March 15th, 2006 @ 4:11 am

Answered my own question….program called “FavOrg”!

JG | March 26th, 2006 @ 8:15 pm

Umm… Photoshop?

Make the icon, drop it in the folder you want it in.

End of tutorial.

john | October 28th, 2006 @ 8:56 am

There’s also a free download for Windows called icon.edit

atg | March 23rd, 2007 @ 2:35 pm

for anyone thats as lazy as i am (and equally bad at typing), you could also create a batch file to do all the nitty-gritty, once youve created the x-16.png and the x-32.png.

to do so, at some point:
- open your Command prompt, stay in your root directory
- type ‘copy con favicon.bat’, hit ENTER
- type ‘cd \png2ico’, hit ENTER
- type ‘png2ico.exe favicon.ico –colors 16 icon-32.png icon-16.png’, hit ENTER *
- hit F6, hit ENTER

then each time to need to make a favicon *:
- open your Command prompt, stay in your root directory
- type ‘favicon’, hit ENTER
- all of the above steps will run and your new favicon.ico file will be in your png2ico directory.

* NOTE: the above process requires you to always save your icon-16.png and icon-32.png in the png2ico directory, and name them ‘icon-16.png’ and ‘icon-32.png’, AND this process will always overwrite the ‘favicon.ico’ that is in the png2ico directory. so, save your PNGs, make your favicon, then move those files out of the png2ico directory before you make another favicon.

Joe W | September 15th, 2007 @ 3:07 pm

Love this blog! I recently found this online generator to make my favicons—
Quick Favicon There are a lot of them out thee. I also recommend downloading The Gimp Gimp It’s open source and can do just about anything Photo Shop can do. I also recommend Irfan View Irfan And if you can manage to find the free version of “Faststone” (not free anymore) which I have. These will do any novice well!

Share your thoughts