DEV Community

albert nahas
albert nahas

Posted on • Originally published at leandine.hashnode.dev

Favicon Best Practices for Modern Web Apps in 2025

A favicon is a tiny detail that speaks volumes about your web app’s professionalism and polish. In 2025, favicons aren’t just 16×16 .ico files for browser tabs—they’re a complex ecosystem of icons spanning dozens of platforms, from classic desktop browsers to mobile home screens and progressive web apps (PWAs). Getting them right is crucial for branding, discoverability, and a seamless user experience. Let’s break down modern favicon best practices, from efficient generation to flawless deployment across the fragmented landscape of devices and platforms.

Why Favicons Still Matter in 2025

Despite their humble origins, favicons have become the face of your web app across browsers, bookmarks, pinned tabs, home screens, and task switchers. A well-crafted favicon:

  • Boosts brand recognition: Users visually identify your app instantly.
  • Enhances professionalism: Broken or missing icons erode trust.
  • Enables installability: PWAs require specific icon formats for add-to-home-screen features.
  • Improves accessibility: High-contrast, well-sized icons cater to all users.

With more platforms and resolutions than ever, let’s see how to meet today’s favicon demands.

The Modern Favicon Ecosystem

Gone are the days of a single favicon.ico. Now, you need to cater to:

  • Classic browsers: .ico and .png in various sizes.
  • Retina and high-DPI displays: Crisp icons at 32×32, 48×48, 64×64, and up.
  • Apple devices: apple-touch-icon in multiple resolutions (180x180 and others).
  • Android/Chrome: icon and manifest.json entries.
  • Windows tiles: msapplication-TileImage and related meta tags.
  • PWAs: Manifest-specified icons, including masks and badges.
  • Safari pinned tabs: SVG mask icons for monochrome rendering.

Missing or misconfigured icons can lead to fallback images, blurry rendering, or default browser icons.

Favicon Formats and Sizes: The 2025 Checklist

Here’s what a robust web app icon setup looks like:

Icon Use Format Typical Sizes HTML/Manifest Reference
Classic favicon .ico 16×16, 32×32, 48×48 <link rel="icon" href="/favicon.ico">
Browser tab (high-DPI) .png 32×32, 64×64, 128×128 <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
Apple touch icon .png 180×180 (at minimum) <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
Android Chrome .png 192×192, 512×512 Manifest icons array
Windows tile .png 150×150 <meta name="msapplication-TileImage" content="/mstile-150x150.png">
Safari pinned tab .svg Any (vector) <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
PWA badge/mask .png/.svg 48×48, 72×72, 96×96, 128×128 Manifest icons + purpose property

Best practice: Generate all relevant sizes and formats, even if your core brand mark is simple.

Generating Favicons: Tools and Automation

Manually creating and cropping dozens of icons is tedious and error-prone. Thankfully, the favicon generator ecosystem in 2025 is rich and sophisticated.

Popular favicon generator tools:

  • RealFaviconGenerator: Web-based, generates all required sizes and HTML/meta tags.
  • favicon.io: Quick generation for text, emoji, or image-based favicons.
  • IcoGenie: AI-powered SVG icon generator, useful for scalable and PWA-ready icons.
  • Favicon Generator by X-Icon Editor: Classic .ico file generator with multi-resolution support.
  • CLI tools (favicons, pwa-asset-generator): Integrate into your build for automation.

Example: Automating with the favicons npm Package

For React, Vue, or other frontend frameworks, automating favicon generation ensures consistency and up-to-date assets.

npm install favicons --save-dev
Enter fullscreen mode Exit fullscreen mode

Then, in a Node script:

import favicons from "favicons";
import { writeFileSync } from "fs";

const source = "logo.svg"; // Your high-res SVG logo

const configuration = {
  path: "/icons/", // Path for icons
  appName: "My Web App",
  appShortName: "App",
  appDescription: "My awesome PWA app",
  developerName: "Your Name",
  developerURL: "https://yourdomain.com",
  icons: {
    android: true,
    appleIcon: true,
    favicons: true,
    windows: true,
    yandex: false,
    appleStartup: false,
    coast: false,
    firefox: false,
    twitter: false,
    facebook: false,
  },
};

favicons(source, configuration)
  .then(response => {
    // Save images and HTML/meta tags to your output directory
    response.images.forEach(image =>
      writeFileSync(`./dist/icons/${image.name}`, image.contents)
    );
    writeFileSync("./dist/icons/meta.html", response.html.join("\n"));
  })
  .catch(console.error);
Enter fullscreen mode Exit fullscreen mode

This automates the creation of all modern favicon assets from a single SVG, ensuring your web app icons stay up to date.

Deploying Favicons: Placement and HTML Tag Snippets

Once generated, favicon assets need to be placed at the root or a predictable path (e.g., /icons/). Reference them in your HTML <head> for maximum compatibility.

Example: Modern Favicon HTML

<!-- Classic favicon -->
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="icon" href="/favicon.ico">

<!-- Apple Touch Icon -->
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">

<!-- Manifest for PWA -->
<link rel="manifest" href="/manifest.json">

<!-- Safari Pinned Tab -->
<link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#5bbad5">

<!-- Windows Tile -->
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-TileImage" content="/icons/mstile-150x150.png">

<!-- Theme color for address bar on mobile -->
<meta name="theme-color" content="#ffffff">
Enter fullscreen mode Exit fullscreen mode

Tip: Always test your favicon on real devices and browsers. Caching issues are common—use cache-busting techniques during development.

Favicon and PWA Icons in manifest.json

PWAs require a manifest.json file with icon definitions:

{
  "name": "My Web App",
  "short_name": "App",
  "icons": [
    {
      "src": "/icons/android-chrome-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "/icons/android-chrome-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    },
    {
      "src": "/icons/maskable-icon.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ],
  "theme_color": "#ffffff",
  "background_color": "#ffffff",
  "display": "standalone",
  "start_url": "/"
}
Enter fullscreen mode Exit fullscreen mode
  • maskable purpose: Allows your icon to be safely cropped for circular/squircle displays on Android.
  • Include at least 192x192 and 512x512: Required for PWA install banners.

SVG Icons: Are They the Future?

SVG is increasingly supported for favicons (especially in Chrome and Safari), offering perfect scaling and tiny file sizes. However, fall back to PNGs for maximum compatibility, as not all platforms fully support SVG favicons yet.

<link rel="icon" type="image/svg+xml" href="/icons/favicon.svg">
Enter fullscreen mode Exit fullscreen mode

Key tip: SVG favicons don’t work everywhere (notably on some Windows and Android systems), so always provide PNG versions as backup.

Accessibility and Design Tips

  • High contrast: Ensure icons stand out against light and dark browser UIs.
  • Simplicity: Avoid tiny text or intricate details—icons are often displayed at 16×16 px!
  • No transparency for iOS: Apple touch icons should have a solid background.
  • Test on both dark and light themes: Some browsers invert icons or overlay them on dark UI.

Common Favicon Pitfalls

  • Only providing a favicon.ico—missing out on rich device support.
  • Using a low-res or blurry icon on high-DPI screens.
  • Not updating the manifest after changing icons.
  • Caching issues after icon updates (force-refresh or use query strings).
  • Forgetting about pinned tabs and maskable icons for PWAs.

Key Takeaways

  • Go beyond favicon.ico: Modern web apps need a suite of icons for browsers, devices, and PWAs.
  • Automate favicon generation: Use tools like RealFaviconGenerator, favicon.io, IcoGenie, or npm packages to keep assets in sync.
  • Reference icons explicitly: Place all relevant <link> and <meta> tags in your HTML <head>.
  • Support PWAs: Ensure your manifest.json includes 192x192, 512x512, and maskable icons.
  • Test everywhere: Check your favicon on all major browsers and devices.

Investing an hour in a robust favicon setup pays off with a more professional, discoverable, and installable web app—now and into the future.

Top comments (0)