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). |
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
- Forgetting
/favicon.icoin 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 forhttps://yourdomain.com/favicon.ico. If this file is missing, your server logs will fill with 404 errors. Always keep a physicalfavicon.icofile in your root public folder. - 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.
- 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?
- 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.svgfiles with one click. - 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:
- Append a version query parameter:
<link rel="icon" href="/favicon.svg?v=2">. - Open the direct image URL in a browser tab (
https://yourdomain.com/favicon.ico) and perform a hard reload (Ctrl+F5orCmd+Shift+R).
Related Tools
Free browser tools related to this guide. Process locally with zero sign-up.
Free Favicon & Web App Icon Package Generator
Generate multi-resolution favicon.ico, Apple Touch Icons, and Android PWA icons from an image, emoji, or text monogram. Preview live across browser tabs and search results with 1-click ZIP package download.
Image Format Converter & Resizer
Batch convert image formats (PNG, JPG, WEBP, AVIF) and resize pixel dimensions locally in your browser with aspect ratio lock.