You need very few files: a favicon.ico (or 32x32 PNG) for browser tabs, an SVG icon if you want a sharp, theme-aware version, a 180x180 apple-touch-icon for iOS home screens, and 192x192 and 512x512 PNGs listed in a web app manifest. Everything else is optional.

Older guides list dozens of sizes, which is mostly a leftover from the days when each device and browser asked for its own file. Modern browsers pick from a short set and scale as needed. The sections below show which files do real work and the exact markup to wire them up. To generate the set from one source image, you can use our favicon and app icon generator.

What each size is for

FileSizeUsed for
favicon.ico16, 32, 48 (multi-size)Browser tabs, bookmarks, legacy fallback
icon.svgScalableModern browser tabs, optional dark mode
apple-touch-icon.png180x180iOS and iPadOS home screen shortcut
icon-192.png192x192Android home screen via manifest
icon-512.png512x512Splash screens and install prompts via manifest
Maskable 512512x512Android adaptive shapes

An ICO file is a container that can hold several bitmaps. Putting 16, 32 and 48 pixel versions in one file lets the browser choose the closest match. Small sizes need to be designed, not just shrunk: a detailed logo at 16 pixels turns to mush, so simplify the mark or use a single letter.

A minimal modern set of link tags

Place these in the head of every page, or in your shared layout:

<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/manifest.webmanifest">

The ICO line is the fallback for browsers without SVG favicon support. The SVG line lets capable browsers use a crisp vector icon. Browsers also request /favicon.ico from the site root by default, so keeping a file there is a good habit even without the tag.

The web app manifest

The manifest tells Android and desktop browsers how your site should look when installed. The icons array is the part that matters here:

{
  "name": "Example Tools",
  "short_name": "Tools",
  "start_url": "/",
  "display": "standalone",
  "background_color": "#ffffff",
  "theme_color": "#0b5fff",
  "icons": [
    { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
    { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" },
    { "src": "/icon-maskable-512.png", "sizes": "512x512",
      "type": "image/png", "purpose": "maskable" }
  ]
}

The sizes value must match the real pixel dimensions of the file. A mismatch can cause the browser to ignore or rescale the icon badly.

Maskable icons and the safe zone

Android may crop launcher icons into a circle, squircle or other shape. A maskable icon is designed to be cropped: the background fills the whole square (no transparent edges), and the important artwork stays inside a central safe zone. The specification defines that zone as a circle centred in the image with a diameter of 80 percent of the icon size, so keep your logo comfortably inside it. Keep the maskable file separate from the regular one, because a regular icon with generous padding looks small when not masked.

SVG favicons with dark mode support

An SVG favicon can contain its own CSS, including a prefers-color-scheme media query that follows the browser's theme. This is useful when a dark logo would vanish on a dark tab strip.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
  <style>
    .bg { fill: #0b5fff; }
    .mark { fill: #ffffff; }
    @media (prefers-color-scheme: dark) {
      .bg { fill: #ffffff; }
      .mark { fill: #0b5fff; }
    }
  </style>
  <rect class="bg" width="32" height="32" rx="6"/>
  <path class="mark" d="M9 23V9h4l3 6 3-6h4v14h-3v-8l-3 6h-2l-3-6v8z"/>
</svg>

Support for SVG favicons varies, so keep the ICO fallback. Also note the media query reflects the browser or OS theme, which is not always the same as the page's own theme.

Google Search and favicons

Google can show your favicon beside results. In general terms, the icon should be a square image whose size is a multiple of 48 pixels, the favicon file and the homepage should both be crawlable, and the icon URL should be stable rather than changing often. The icon should also be an appropriate, recognisable representation of the site. Check Google's current favicon documentation for the authoritative rules, since display depends on Google's own processing and can take time to update.

Caching pitfalls

Browsers cache favicons aggressively and often separately from normal page assets, so a changed icon may not appear for a long time on your own machine. Common fixes are to give the new file a different name, add a version query string such as /icon.svg?v=2, or clear the browser's site data. For stable search appearance, avoid changing the URL needlessly after you have settled on one.

Native app icons in brief

If you also ship native apps, the rules differ from web icons. For iOS, the App Store listing needs a 1024x1024 icon, and Xcode builds the smaller sizes from asset catalogs; the artwork should be square with no transparency, because the system applies the rounded corners. On Android, adaptive icons consist of a separate foreground and background layer that the launcher masks and may animate, so keep the foreground within the safe area. Always check the current platform guidelines for exact requirements.

Common mistakes

  • Providing a single 16px file. It looks blurry on high-density screens and cannot serve iOS or Android.
  • A transparent apple-touch-icon. iOS fills transparent areas with black. Use an opaque background.
  • Wrong sizes in the manifest. Declared sizes must match the file's real dimensions.
  • Putting the logo at the edge of a maskable icon. The mask crops it. Stay inside the safe zone.
  • Forgetting to update after a rebrand. Cached icons linger; version the filename.
  • Blocking the icon in robots.txt. Crawlers then cannot fetch it.

Frequently Asked Questions

Do I still need favicon.ico?

It is still worth having. It works in every browser, is requested by default from the site root, and acts as the fallback when SVG is not supported.

What size should apple-touch-icon be?

180x180 pixels is the standard for current iPhones and iPads. Make it opaque and square, and let iOS apply the rounded corners.

Why does my old favicon still show after I changed it?

Browsers cache favicons for a long time. Rename the file or add a query string, then reload; clearing site data also helps.

Do I need both 192 and 512 icons in the manifest?

Listing both is the usual minimum for installability on Android, with the larger one used for splash screens and high-resolution contexts.