Favicon sizes: the icon files a site needs
A typical site needs four icon files: a favicon.ico holding small sizes such as 16, 32 and 48 px, anapple-touch-icon.png at 180 × 180 px, and two PNG icons at 192 × 192 and 512 × 512 px listed in a web app manifest. Browsers pick the most suitable file for each place they show your icon.
Our favicon generator makes exactly this set from one square image, plus the manifest and the HTML tags to paste into your pages.
Each file and why it is there
| File | Size | What the official documentation says |
|---|---|---|
| favicon.ico | 16, 32 and 48 px in one file (our generator) | MDN: rel="icon" links the page icon, and favicon.ico is its most common use. ICO is one of the few icon formats that “can store multiple icon sizes in a single file”. |
| apple-touch-icon.png | 180 × 180 px | MDN: iOS does not use rel="icon" for home-screen icons but the non-standard apple-touch-icon. Apple's guide places it in the root folder and shows sizes="180x180" for a high-resolution iPhone icon. |
| icon-192.png | 192 × 192 px | MDN: for Chromium-based browsers, including Chrome, Samsung Internet and Edge, the manifest's “icons must contain a 192px and a 512px icon” for the site to be installable. |
| icon-512.png | 512 × 512 px | The second icon in that same requirement. |
| site.webmanifest | Text file | Lists the 192 and 512 px icons with their sizes. MDN recommends stating the exact sizes for PNG icons. |
The 192 and 512 px requirement is about installing your site as an app on those browsers. Even if that is not your plan, the two files are small and do no harm, as the example further down shows.
What the sources do not tell you
None of the pages we checked states the exact pixel size a browser draws a favicon at in a tab. The W3C Web Application Manifest leaves the choice to the browser, which “will choose the most suitable icons for different contexts and placements”, and MDN describes the same for rel="icon": with several icons, the browser uses themedia, type and sizes attributes “to select the most appropriate icon”.
So the safe approach is to offer a few sizes and let the browser choose. That is why our favicon.ico carries 16, 32 and 48 px images rather than one, and why the larger icons are separate files with their sizes stated.
Apple's guide is also old: it sits in Apple's documentation archive, last updated in 2016, and points to the Human Interface Guidelines for current sizes. We use its 180 × 180 example because it is the largest of the sizes it shows, and Apple's own rule is that when no icon matches, the device uses the smallest one larger than it needs.
Google Search has its own, looser rule: a favicon “must be a square (1:1 aspect ratio) that's at least 8x8px”, and Google recommends one “larger than 48x48px”. ICO and PNG are among the formats it accepts.
The HTML that links them
Our generator gives you these four tags to paste inside the <head> of every page:
<link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/site.webmanifest">Each path starts with a slash, so the files belong in the root folder of your site, next to your home page. Apple's guide notes that iOS also looks for apple-touch-icon.png in the root folder when no link is given, which makes the root a safe place for it either way. If your site lives in a subfolder, change the paths to match.
What our generator makes from a logo
Icons are small files. Even the 512 px PNG here is under 13 KB, so there is no reason to skip any of them for speed.
Preparing the image
- Start square, at 512 px or more. The largest icon is 512 × 512. A smaller source has to be enlarged for it and will look soft. If your file is SVG, draw it at 512 px with the SVG to PNG converter first.
- Decide what to do with a wide logo. Add space around it keeps the whole logo but makes it small inside the square. Crop the middle fills the square but cuts the ends off. Often the best answer is to use only the symbol: cut it out with the square crop tool before you start.
- Design for 16 px. At 16 × 16 there are only 256 pixels. Thin lines and small letters turn to mush; one bold letter or a simple shape stays readable.
- Transparency is your choice, except on the Apple icon. Our generator keeps clear pixels clear in favicon.ico and the 192 and 512 px PNGs if you leave transparency on, but always puts the 180 px Apple touch icon on a solid background colour, white unless you pick another.
If you only need one square PNG, for example a 512 px app or avatar image, the512 × 512 resizer does that without the rest of the set.
Questions
Do I still need favicon.ico if I have PNG icons?
It is the simplest file to rely on. MDN names favicon.ico as the most common use of rel="icon", and ICO can hold several sizes in one file, so one link covers small and larger uses.
Can a favicon be a JPG?
Google Search lists JPEG among the formats it accepts. A JPG cannot be transparent, though, so the icon will be a solid square. Our generator turns any input into PNG images.
What about an SVG favicon?
MDN notes that a vector icon can use sizes="any". Our generator does not make SVG icons; it makes PNG images only.