Favicon Sizes and File Formats: ICO, PNG and SVG
You can start with one square image. Everything else is a question of which file type to save it as and how many sizes to include.
The size numbers
Two sets of numbers matter, and they answer different questions.
The usual favicon, per MDN, measures 16 x 16 pixels1. Think of a small square on a tab. Wikipedia lists the sizes found in ICO files as 16×16, 32×32, 48×48 or 64×64 pixels2.
Google sets its own minimum for search results. The favicon must be square (a 1:1 aspect ratio) and at least 8x8 pixels3. Google's page also recommends a favicon larger than 48x48 pixels so it looks good on different surfaces3.
So a square design larger than 48 pixels on a side follows Google's stated advice3. Browsers can then shrink it for tabs.
The file types
| Type | What the sources say |
|---|---|
| ICO | Can store several icon sizes in one file, and has better browser support than the other multi-size format4 |
| PNG | Named by MDN as a usual favicon format1 |
| GIF | Named by MDN as a usual favicon format1 |
| SVG | Supported by all modern browsers, stays sharp at any size, not supported by Internet Explorer2 |
Google Search accepts a longer list: BMP, GIF, ICO, PNG, JPEG, PPM and TIFF3. SVG isn't on that list. If you want an icon in Google's results, include a file type from it.
Why ICO is still around
Most image formats hold one picture. MDN notes that most of the time the sizes attribute therefore has only one entry, while ICO can store several sizes in a single file4. MDN adds that ICO has better browser support, so it suggests the format when cross-browser support is a concern4.
Why SVG is tempting
SVG is a vector format. It's described by shapes, not pixels. Wikipedia says all modern browsers support SVG favicons, which stay sharp at any size2. It also says an SVG favicon can change its colours to suit a light or dark browser setting2.
Check the limits, though. Internet Explorer doesn't support SVG favicons2. And Google's list of formats for search results leaves SVG out3.
A practical set
Based on what the sources say, a cautious set looks like this:
- A square master image, drawn larger than the tab size.
- An ICO file, for the widest browser support4.
- A PNG, which both MDN and Google name as a supported type13.
- An optional SVG for modern browsers2.
Phones and installed web apps ask for other sizes again. Those are explained in the iPhone icon guide and Web app manifest icons explained. To wire the files into a page, use the steps in adding a favicon in HTML.
Sources used
- Favicon - Glossary, MDN Web Docs
- Favicon, Wikipedia
- Define a favicon to show in search results, Google Search Central
- <link>: The External Resource Link element, MDN Web Docs