Favicon and App Icon Guide: Files, Sizes and Setup
What to put in your site's head, which sizes still matter, how dark mode, iPhone and Android icons work, and what to check when Google or a browser shows the wrong icon.
1. Which favicon and app icon files you need
A favicon started in 1999 as one 16 × 16 file called favicon.ico in the root of a website. Phones, high-density screens and installable web apps later added more files, and some older guides still list twenty or more sizes. Browsers scale icons well now, so a short set covers almost every case:
- icon.svg for browser tabs in current browsers. It stays sharp at any size and can change colour in dark mode.
- favicon.ico as the fallback, for older browsers and for apps that request
/favicon.icowithout reading your HTML. - apple-touch-icon.png at 180 × 180 for iPhone and iPad home screens.
- 192 × 192 and 512 × 512 PNGs plus a
site.webmanifestfor Android home screens and installed web apps.
Windows tiles (browserconfig.xml) and Safari's old pinned-tab mask icon are no longer needed for most sites. The favicon generator makes this whole set from a letter, an emoji or your logo.
2. Favicon sizes and where each one is used
| Size | Used for | File |
|---|---|---|
| 16 × 16 | Browser tabs and bookmarks on standard screens | favicon.ico, icon.svg |
| 32 × 32 | Tabs on high-density screens, Windows taskbar shortcuts | favicon.ico, icon.svg |
| 48 × 48 | Google's recommended minimum for search results | icon.svg or a 48 px PNG |
| 180 × 180 | iPhone and iPad home screen | apple-touch-icon.png |
| 192 × 192 | Android home screen shortcut | PNG listed in the manifest |
| 512 × 512 | Install dialog and splash screen for web apps | PNG listed in the manifest |
| 1024 × 1024 | App Store and Xcode (native iOS apps only) | AppIcon.appiconset |
One .ico file can hold several sizes. A good one contains 16, 32 and 48 px versions, so Windows and older browsers can pick the sharpest.
3. Favicons that work in dark mode
A black or navy logo on a transparent background almost disappears on a dark tab bar, and a white logo vanishes in light mode. There are two reliable fixes: put the logo on a solid tile in every PNG and ICO file, and use an SVG favicon whose colours change with a prefers-color-scheme media query inside the file.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<style>
.bg { fill: #4f46e5; }
@media (prefers-color-scheme: dark) { .bg { fill: #a5b4fc; } }
</style>
<rect class="bg" width="100" height="100" rx="22"/>
</svg>Chrome, Edge and Firefox apply the media query. Safari shows SVG favicons from version 26, but a WebKit bug report from Safari 26.3 says it doesn't switch colours yet. The icon follows the operating system's theme, not a light/dark button on your site. The dark mode favicon page covers colour choices and workarounds.
4. iPhone and iPad app icons
Websites only need apple-touch-icon.png at 180 × 180. iOS rounds the corners itself, so the image should be a full square with a solid background.
Native apps are different. Since iOS 18, people can show home-screen icons as light, dark or tinted, and Xcode 16 and later accept a 1024 × 1024 image for each look in an AppIcon.appiconset with a Contents.json. Apple asks for the dark icon to have a transparent background, and for the tinted icon to be greyscale, because iOS applies the user's tint colour itself. In iOS 26, Apple added Liquid Glass icons made in its Icon Composer app; the asset catalog still covers iOS 18. Details are on the iOS app icon generator page.
5. Android adaptive and maskable icons
Android launchers cut icons into their own shapes: circles on some phones, rounded squares or squircles on others. Anything near the edge of your icon can be cut off.
- Web apps use a maskable icon: a PNG listed in the manifest with
"purpose": "maskable", with the important part inside a centred circle 80% of the icon's width. - Native apps use adaptive icons: separate foreground and background layers of 108 × 108 dp, with the logo inside the central 66 × 66 dp. Android 13 and later can also use a monochrome layer for themed icons.
The Android adaptive icon page explains how much padding each kind needs.
6. How Google shows your favicon in search
Google shows a small icon next to each search result, taken from your home page. Its documentation asks for:
✔ A square image of at least 8 × 8 pixels. Google recommends 48 × 48 or larger, and an SVG counts as any size.
✔ A crawlable address that robots.txt doesn't block, and that stays the same over time.
✔ An icon that represents your brand. Google replaces icons it considers inappropriate, such as hate symbols or adult images, with a default.
A favicon doesn't affect rankings. After you change it, Google updates the icon when it next crawls your home page, which can take days or a few weeks.
7. Adding icons in Next.js, Astro and plain HTML
Put favicon.ico, icon.svg and apple-icon.png in the top level of app/, and Next.js writes the head tags. Rename apple-touch-icon.png to apple-icon.png first. See the Next.js favicon page for the manifest and the Pages Router.
Copy the files into public/ and add the link tags to the head of your main layout, such as src/layouts/Layout.astro or index.html.
Upload the files to your site's root folder and add these four lines inside <head>:
<link rel="icon" href="/icon.svg" type="image/svg+xml" sizes="any"> <link rel="icon" href="/favicon.ico" sizes="32x32"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="manifest" href="/site.webmanifest">
8. When the old favicon won't go away
Browsers keep favicons in a cache of their own, separate from the page, so an old icon can stay for days after you replace it. Check in a private window first: if the new icon shows there, your files are fine.
- Add a version to the link, such as
/icon.svg?v=2, so every browser fetches the file again. - Open
/favicon.icoand/icon.svgon your site directly. A 404 means the files are in the wrong folder. - If you use a CDN such as Cloudflare, purge its cache.
- In Next.js, delete any old
favicon.icoinpublic/, which can conflict with the one inapp/.
Make your icon set
Free and without sign-up. Your logo stays in your browser while the icons are made.
Open the favicon generator