Favicon sizes and formats: ICO, PNG and SVG
You don't need a dozen files. You need to know what each size and type is for, then pick the few that suit your site.
The size rules that are written down
Google gives the clearest numbers. A favicon for Google Search must be a square (1:1 aspect ratio) that's at least 8x8px.1 That's the floor, not a target.
The same page recommends a favicon that's larger than 48x48px.1 So if you're making one image to cover the most ground, start at a size above that and keep it square.
Square matters because the picture gets squeezed into a square slot. A wide logo would shrink until the details vanish.
Formats, one at a time
Google Search supports these favicon file formats: BMP, GIF, ICO, PNG, JPEG, PPM and TIFF.1 That's a long list, and it's only what Google reads. Browsers differ, so the table below sticks to the three formats most small sites use.
| Format | What to know |
|---|---|
| ICO | Can store multiple icon sizes in a single file.2 MDN says it has better browser support, so use it if cross-browser support is a concern.2 |
| PNG | Most icon formats can store only one single icon, so a PNG file usually covers one size.2 |
| SVG | Wikipedia says all modern browsers support SVG favicons.3 Internet Explorer doesn't.3 |
Why SVG helps
SVG is a vector format. It describes shapes with maths instead of a grid of dots, so it can scale. The HTML standard calls this a scalable icon, as provided by an SVG image.4
That means one file can serve the tab, the bookmark list and anywhere larger. Wikipedia's page says SVG favicons stay sharp at any size, and a single link entry can cover all icon sizes.3
Why ICO is still around
An ICO file is a container. It can hold several pictures at once.2 Wikipedia lists the usual sizes inside such files as 16×16, 32×32, 48×48, or 64×64 pixels.3
It's also the oldest route. Browsers ask for this file by name without being told, as the page on what a favicon is explains.2 Having one there means that request finds something.
Bigger sizes for phones
Phones want larger pictures than tabs do. For Android home screens, Wikipedia says Google recommends providing icons in 192x192 pixels.3 Apple devices ask for their own sizes. The home screen page lists them.
You don't have to solve this on day one. A tab icon is enough to start, and you can add the phone sizes later.
A sensible small set
Here's one way to put it together, based on what the sources above say:
- A square SVG, if you want one file that scales.
- An ICO file as the fallback for browsers that don't read SVG.
- One larger PNG for phone home screens.
Check each one by opening it on its own. If it looks muddy when small, the problem is the design, not the format. Designing a readable favicon covers that.
When you've made the files, add them with HTML link tags. Any sizes you declare there should match what's really inside each file.
Notes and sources
- Define a favicon to show in search results, Google Search Central
- <link>: The External Resource Link element, MDN Web Docs
- Favicon, Wikipedia
- HTML Standard, link type icon, WHATWG