A decade ago, setting up a website favicon was a frustrating chore. Online generators spit out zip files containing 20+ files: favicon-16x16.png, favicon-32x32.png, ms-tile-144x144.png, apple-touch-icon-76x76.png, and a dozen other obscure resolutions designed for forgotten devices like Windows Phone and early iPads.

In modern web development, that legacy bloat is completely obsolete.

Thanks to universal evergreen browser adoption and modern web specifications, you only need three image files and one web manifest to support 99.9% of all devices, desktop browsers, high-DPI Retina screens, dark mode themes, and mobile home screen shortcuts.

Here is the ultimate modern favicon specification, complete with dark mode SVG styling and the minimal HTML setup.


The Lean Modern Favicon Standard (Only 3 Files)

Instead of filling your public folder with dozens of static PNGs, the modern standard relies on vector scalability and three targeted fallbacks:

public/
├── favicon.ico              # 32x32 ICO fallback for legacy clients & crawlers
├── favicon.svg              # Scalable vector icon with automatic dark mode support
├── apple-touch-icon.png     # 180x180 PNG for iOS home screen bookmarks
└── site.webmanifest         # JSON file referencing 192px and 512px icons for Android/PWA
File Name Dimensions Format Primary Purpose
favicon.svg Scalable vector SVG Modern browsers (Chrome, Firefox, Edge, Safari 16+). Scales infinitely and changes color in dark mode.
favicon.ico 32x32 (or multi-size 16/32/48) ICO Legacy browser fallback, desktop bookmarks, RSS readers, search engine crawlers.
apple-touch-icon.png 180x180 PNG iOS Safari home screen bookmarks and Apple ecosystem previews.
site.webmanifest JSON metadata JSON Chrome on Android home screen installation and Progressive Web Apps (PWAs).
Diagram illustrating the modern 3-file favicon architecture comparing SVG, ICO, and PNG standards against legacy bloat
Figure 1: The modern 3-file favicon suite: scalable SVG with dark mode support, 32×32 ICO fallback, and 180×180 Apple Touch Icon.

The Minimal HTML Code Snippet

Paste this lean block directly into the <head> of your website or Astro/HTML layout template:

<!-- 1. The classic ICO fallback for legacy browsers -->
<link rel="icon" href="/favicon.ico" sizes="32x32">

<!-- 2. The modern scalable SVG icon -->
<link rel="icon" href="/favicon.svg" type="image/svg+xml">

<!-- 3. Apple Touch Icon for iOS bookmarks -->
<link rel="apple-touch-icon" href="/apple-touch-icon.png">

<!-- 4. Web Manifest for Android & PWA installs -->
<link rel="manifest" href="/site.webmanifest">

Why Place .ico Before .svg?

While this ordering may seem counterintuitive, placing <link rel="icon" href="/favicon.ico" sizes="32x32"> before <link rel="icon" href="/favicon.svg" type="image/svg+xml"> is intentional. When both tags are present, modern browsers parse the list sequentially, recognize the image/svg+xml type, and pick the SVG over the ICO. Older browsers that don’t recognize SVG safely ignore the second tag and use the ICO.


Supercharging Your Favicon with Dark Mode SVG

One of the biggest advantages of using an SVG favicon is dynamic styling. A dark black logo looks great on a light browser tab, but becomes completely invisible when a user switches their operating system to dark mode.

With SVG, you can embed CSS media queries directly inside the <svg> file itself:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <style>
    path {
      fill: #1e293b; /* Default dark fill for light mode tabs */
    }
    @media (prefers-color-scheme: dark) {
      path {
        fill: #38bdf8; /* Vibrant light blue fill for dark mode tabs */
      }
    }
  </style>
  <path d="M50 10 L90 90 L10 90 Z" />
</svg>

When the user changes their system or browser theme from light to dark, the tab icon updates instantly—without requiring a single line of JavaScript.


Creating the Web Manifest (site.webmanifest)

For Android devices and PWAs, create a simple site.webmanifest in your public/ directory:

{
  "name": "My Modern Web App",
  "short_name": "WebApp",
  "icons": [
    {
      "src": "/icon-192.png",
      "type": "image/png",
      "sizes": "192x192"
    },
    {
      "src": "/icon-512.png",
      "type": "image/png",
      "sizes": "512x512"
    }
  ],
  "theme_color": "#ffffff",
  "background_color": "#ffffff",
  "display": "standalone"
}

Common Mistakes to Avoid

  1. Forgetting /favicon.ico in the root directory: Even if you declare your icons in the HTML <head>, automated search engine crawlers, RSS aggregators, and older API integrations look directly for https://yourdomain.com/favicon.ico. If this file is missing, your server logs will fill with 404 errors. Always keep a physical favicon.ico file in your root public folder.
  2. Serving massive PNG files as favicons: Never link a 5 MB raw camera photo or 2000px logo as your favicon. The browser must download and render this asset before tab initialization completes, which degrades your Largest Contentful Paint (LCP) and page performance metrics.
  3. Using rounded corners in apple-touch-icon.png: iOS automatically applies a squircle mask, drop shadow, and gloss effect to home screen icons. If you pre-round the corners of your icon, iOS will render strange black artifacts along the edges. Always upload a square 180x180 PNG with a solid background.

How to Generate Your Favicon Suite

Need to convert your logo into the modern favicon suite?

  1. Generate Favicons in Seconds: Use our free Favicon Generator on DwellixTools to upload any image or vector artwork and automatically export crisp .ico, .png, and dark-mode .svg files with one click.
  2. Resize Source Logos: If you have high-resolution source graphics that need exact 180x180, 192x192, or 512x512 dimensions, adjust them without quality loss using our browser-based Image Resizer.

Frequently Asked Questions

Is ICO still required in 2026?

Yes, but only as a fallback. While all major browser tabs support SVG and PNG icons, search engine robots, bookmark bars, and legacy enterprise software continue to look for favicon.ico by default. Providing a single 32x32 ICO file ensures universal backwards compatibility.

Why shouldn’t I use a transparent background for Apple Touch Icons?

Apple’s iOS home screen does not support transparency for web clip icons. If you upload an apple-touch-icon.png with a transparent alpha channel, iOS will replace the transparent areas with a solid pitch-black background. Always give your Apple touch icon a solid brand background color.

How do I force browsers to clear an old cached favicon?

Favicons are heavily cached by browsers, sometimes persisting for weeks. To force an immediate refresh during development:

  1. Append a version query parameter: <link rel="icon" href="/favicon.svg?v=2">.
  2. Open the direct image URL in a browser tab (https://yourdomain.com/favicon.ico) and perform a hard reload (Ctrl+F5 or Cmd+Shift+R).