Update (2019): While this approach still works, it is more common to use other file formats for website icons, such as png's.
favicon.ico, you don't need anything other than ImageMagick.
Use it to convert
.ico (use 32px and 16px sizes for retina compatibility).
You can even use it to generate a 16px version from a 32px: