The Ultimate Guide to the Best Tools for Creating Favicons for Dark Mode
In the modern web development landscape, user experience extends far beyond responsive layouts and fast load times. One of the most subtle yet powerful ways to engage your audience is through the favicon – that tiny icon that appears in browser tabs, bookmarks, and history. As dark mode becomes a standard feature across operating systems and browsers, the need for a favicon that adapts to both light and dark themes has emerged as a critical design requirement. Without a properly configured dark mode favicon, your carefully crafted icon may become invisible or visually jarring when a user switches to a dark interface, leading to brand inconsistency and a diminished user experience. This comprehensive tutorial will walk you through everything you need to know about creating favicons for dark mode, from the underlying technical concepts to the best tools available in 2025. Whether you are a front‑end developer, a designer, or a site owner, you will learn how to leverage modern tools to deliver a seamless favicon experience that looks stunning in any color scheme.
Before diving into the specific tools, it is essential to understand how dark mode favicons actually work under the hood. The principle is based on the prefers-color-scheme CSS media query, which allows developers to detect a user’s system‑wide colour preference. This same query can be used inside an HTML <link> element to serve different favicon sources depending on the theme. For example, you can provide two separate icon files – one optimised for light backgrounds (e.g., a dark‑coloured icon) and one for dark backgrounds (e.g., a light‑coloured or inverted icon). The browser, when it loads your page, checks the user’s preference and loads the appropriate favicon. This approach is supported by all major browsers, including Chrome, Firefox, Edge, and Safari (though with some nuances regarding SVG favicons). The technical implementation is straightforward, but the real challenge lies in creating the actual icon assets that work perfectly in both modes. That is where the right tools come into play. In the following sections, we will explore the best tools that simplify the entire workflow – from initial design to final export – with a specific focus on dark mode support.
Step‑by‑Step Guide to Creating Dark Mode Favicons with the Best Tools
Step 1: Understand the Required Asset Structure for Dark Mode Favicons
The first step is to mentally and technically prepare for the fact that you will need at least two distinct favicon files. While you can technically use a single SVG favicon that contains a CSS media query inside the SVG file itself, this approach is less universally supported and can lead to inconsistent behaviour across browsers. The safest and most reliable method is to create two separate favicon images: one for light mode (e.g., “favicon-light.png”) and one for dark mode (e.g., “favicon-dark.png”). You will also need to include the appropriate <link> tags in your HTML. For light mode, the standard <link rel="icon" href="favicon-light.png" sizes="any"> works, but for dark mode you must add a second <link> with the media="(prefers-color-scheme: dark)" attribute. Many tools today automate the generation of these HTML snippets. When choosing a tool, ensure it supports outputting both light and dark favicons and provides the corresponding markup. Additionally, you should consider providing a default favicon (usually the light version) in case the browser does not support the media query or the user has no preference. Understanding this foundational structure will help you evaluate each tool’s output and ensure you don’t accidentally serve the wrong icon.
Step 2: Use RealFaviconGenerator – The Industry Standard for Multi‑Mode Favicons
RealFaviconGenerator (RFG) is arguably the most comprehensive and popular favicon generator available today. It supports not only dark mode but also all modern favicon requirements, including Apple touch icons, Android splash screens, maskable icons, Windows tile images, and more. The tool allows you to upload a single high‑resolution source image (typically 260×260 pixels or larger) and then configure multiple variations. To create a dark mode favicon with RFG, you can either upload two separate images (one for light, one for dark) or use a single image with a transparent background and rely on the tool’s “background color” settings. For dark mode, RFG provides a dedicated option where you can explicitly set a different icon for dark backgrounds. After you configure your preferences, the generator produces a complete favicon package, including all required sizes, HTML code, and even iOS and Android meta tags. The generated HTML will include the proper media attribute for dark mode. RFG also offers a “RealFaviconGenerator” browser extension that lets you test the favicon on your live site. The only downside is that the free version requires you to manually copy the HTML, while the paid version (favicon package) offers a one‑click installation for some CMS platforms. Overall, RFG is the most reliable tool for anyone who needs a turn‑key solution that covers every platform and both color schemes.
Step 3: Leverage Favicon.io for Quick, Minimalist Dark Mode Support
Favicon.io is another excellent online generator, but its dark mode capabilities are more limited compared to RFG. Favicon.io works best when you start from text or an emoji, or when you upload a square PNG. The tool automatically generates basic favicon sizes (16×16, 32×32, 48×48, and 64×64) and an Apple Touch Icon, but it does not have an explicit UI toggle for dark mode favicons. However, you can still use Favicon.io to create a dark mode version by manually generating two separate favicons – one using a dark background and light icon (for light mode) and one using a light background and dark icon (for dark mode). Since Favicon.io allows you to upload any PNG, you can use an image editor to create the two variants, then use the tool to generate the ico/png set for each variant. After that, you edit your HTML manually to add the media attribute. Favicon.io is a good choice if you want a very simple, fast generator and you are comfortable manually handling the dark mode HTML integration. It is also free and does not require an account. For users who only need a basic favicon and are not concerned with maskable icons or splash screens, Favicon.io is a lightweight but effective option.
Step 4: Design and Export Dark Mode Favicons Using Vector Tools (Figma, Adobe Illustrator, or Inkscape)
While online generators are convenient, they often impose limitations on how you design the icons. For full creative control, you should design your favicons using a vector graphics editor. Tools like Figma (browser‑based), Adobe Illustrator, or the free Inkscape allow you to create scalable icons with precision. To support dark mode, you design two separate artboards: one for the light theme (typically using a dark foreground on a light or transparent background) and one for the dark theme (using a light foreground on a dark or transparent background). Because favicons are extremely small, you should aim for simple, high‑contrast shapes that remain recognisable at 16×16 pixels. Once your designs are ready, you export them as PNG files (at least 260×260 for subsequent resizing) or directly as SVG if you prefer. If you export as SVG, you can embed a prefers-color-scheme media query inside the SVG file itself, which theoretically allows a single file to serve both themes. However, browser support for this method is not universal (Safari, for example, only respects the HTML media attribute, not the SVG‑internal query). Therefore, the safest approach remains exporting two PNGs and using the HTML technique. Vector tools are also excellent for creating maskable icons (required for Android adaptive icons) and for ensuring your favicon has a consistent visual language across all platforms. Figma is particularly recommended because of its collaborative features and the availability of community plugins (e.g., “Favicon Export” or “SVG to Favicon”) that streamline the process of generating multiple sizes.
Step 5: Automate Production with Command‑Line Tools like Sharp or Squoosh
If you are a developer who prefers automation over manual clicks, command‑line tools are a fantastic way to generate dark mode favicons programmatically. Node.js packages such as Sharp or Squoosh CLI can resize, optimise, and convert images directly from the terminal. To create both light and dark favicons, you first prepare your source images (e.g., logo‑light.png and logo‑dark.png) and then run a script that outputs all required sizes (16×16, 32×32, 48×48, 64×64, 96×96, 180×180, 192×192, 512×512). You can also combine this with a separate script that generates the HTML snippet with the media queries. For example, using Sharp in a Node.js script, you can loop through an array of sizes and use the resize() method to produce output files. Additionally, the npm package favicons by Hay Kranen is a comprehensive favicon generator that can be integrated into build systems like Webpack or Gulp. It supports dark mode through a configuration option where you can specify a different SVG file for dark mode. This package generates all necessary icons, including maskable icons and manifest files, and outputs the complete HTML. The learning curve is steeper than using a web tool, but for continuous integration or large‑scale projects, automation saves countless hours and ensures consistency.
Step 6: Test and Validate Your Dark Mode Favicons Across Browsers
After generating your favicons, testing is non‑negotiable. Not all browsers handle dark mode favicons identically, and subtle differences can break the experience. Start by inspecting your page in Chrome with the DevTools rendering settings: toggle the “prefers-color-scheme” emulation to “dark” and check the tab icon. Firefox has a similar feature under the “Responsive Design Mode” or by adjusting the ui.systemUsesDarkTheme flag. Safari’s testing can be trickier because it relies on the macOS system appearance; you can switch your system to dark mode and reload the page. Edge behaves similarly to Chrome. For a more systematic approach, use tools like BrowserStack or Sauce Labs to test on real devices. Also, pay attention to the favicon in bookmarks, history, and the address bar (especially in Safari where the favicon appears in the Smart Search field). One common pitfall is that some browsers cache the favicon aggressively, so you may need to force a refresh by clearing the cache or using a versioned URL (e.g., favicon-light?v=2). Finally, check that your favicon also works when the user’s system is set to “no preference” (the default). In that case, the browser will load the light mode favicon (if it is defined as the rel="icon" without media attribute). By thoroughly testing, you ensure a flawless experience for every visitor regardless of their theme preference.
Tips and Best Practices for Dark Mode Favicons
Tip 1: Always Provide a Transparent Background for Maximum Flexibility
When designing your favicon, using a transparent background (instead of a solid white or black) gives the browser more freedom to render the icon appropriately across various surfaces. For example, macOS’s Dock and Safari’s tab bar already have their own background colours, and a transparent favicon will adapt more naturally. However, in dark mode, a transparent background may make a dark‑coloured favicon invisible on dark surfaces. To solve this, you can design the light mode version with a dark foreground and transparent background, and the dark mode version with a light foreground and a dark semi‑transparent background (or a small contrasting outline). Tools like RealFaviconGenerator often allow you to specify a background colour for the icon in dark mode, which is a great fallback. The key is to ensure that in both modes the icon has enough contrast with the default browser‑tab background (which is usually white in light mode and near‑black in dark mode). A common best practice is to test your favicon on both a white and a black background in an image editor before exporting.
Tip 2: Keep It Simple and Avoid Fine Details
Favicons are displayed at incredibly small sizes – typically 16×16 pixels for the browser tab. Even if you generate a 512×512 version for Android, the most critical size is that tiny 16-pixel square. Therefore, intricate details, thin strokes, and small text will become illegible or turn into a messy blur when scaled down. For dark mode favicons, this principle is even more important because the contrast between the icon and the background must be clear at a glance. Stick to bold shapes, a limited colour palette (ideally two or three colours), and high contrast. For example, a simple solid‑color silhouette of your logo works much better than a detailed illustration. If your brand uses a complex logo, consider creating a simplified “favicon version” that retains the core identity. Many companies use a single letter, an abstract mark, or a minimised symbol. When you design for both light and dark modes, you can use the same simplified shape but swap the colour scheme. This consistency helps users instantly recognise your site in either theme.
Tip 3: Include the mask-icon for Safari and Its Dark Mode Implications
Safari on macOS and iOS supports a special <link> element with rel="mask-icon" that uses a single‑colour SVG to render the favicon in the tab bar. Safari applies its own colour (usually a dark grey or blue) to this icon, so you do not need separate light/dark versions for the mask‑icon. However, you still need to provide a PNG favicon for other browsers. When you use RealFaviconGenerator or a similar tool, it will automatically generate the mask‑icon SVG for you. For the mask‑icon, you should use a solid black SVG (since Safari will fill it with its own colour), and the icon should fit within a square viewBox. Even though the mask‑icon itself is unaffected by dark mode, it is good practice to include it because it enhances the favicon appearance in Safari. Moreover, you can also use the theme-color meta tag with a media="(prefers-color-scheme: dark)" attribute to change the browser chrome colour for your site in both themes, which works hand‑in‑hand with a well‑designed favicon.
Reference Data: Comparison of Popular Favicon Tools for Dark Mode
| Tool | Dark Mode Support | Ease of Use | Output Quality | Price | Best For |
|---|---|---|---|---|---|
| RealFaviconGenerator | Excellent – dedicated dark mode upload and HTML generation | Very easy – guided wizard | High – includes all sizes and meta tags | Free (pro version available) | Comprehensive all‑in‑one solution |
| Favicon.io | Limited – no dedicated dark mode UI; manual dual generation needed | Easy – simple text/upload interface | Good – basic sizes, but no maskable icons | Free | Quick text‑based favicons |
| Figma (with plugins) | Full control – design both versions manually | Moderate – requires design skills | Excellent – vector quality, unlimited sizes | Free plan (paid for teams) | Design‑heavy workflows |
| Sharp / Squoosh CLI | Full control via scripting – best for automation | Difficult – requires command‑line knowledge | Excellent – lossless/minimal optimisation | Free (open source) | Developers automating builds |
| Favicons npm package | Very good – configurable dark mode via SVG input | Moderate – needs Node.js setup | Excellent – production‑ready | Free (open source) | CI/CD pipelines |
Browser Support for Dark Mode Favicons (as of 2025)
| Browser | Supports media attribute on <link> |
Supports SVG favicon with internal media query | Notes |
|---|---|---|---|
| Google Chrome (desktop & Android) | Yes | Yes | Best support; also honours prefers-color-scheme in SVG |
| Mozilla Firefox | Yes | Partial – only if SVG is served with correct MIME type | Works well with HTML media attribute |
| Apple Safari (macOS & iOS) | Yes | No – does not read media queries inside SVG | Use HTML attribute only; also supports mask‑icon |
| Microsoft Edge | Yes | Yes | Chrome‑based, same behaviour |
| Opera | Yes | Yes | Chrome‑based |
| Samsung Internet | Yes | Yes | Android‑based |
Frequently Asked Questions (FAQ) About Dark Mode Favicons
Q1: Can I use just one favicon for both light and dark modes?
Technically yes, you can create a single SVG favicon that contains two <style> blocks or two separate paths with media queries inside the SVG itself. However, this approach has inconsistent support across browsers. For example, Safari ignores media queries inside SVG favicons, so you would lose the dark mode effect entirely in that browser. Similarly, older versions of Chrome had quirks. The industry best practice is to serve two separate favicon files (PNG or ICO) using the HTML media attribute. This method is widely supported and guarantees a consistent experience. If you still want to experiment with a single SVG, you should have a fallback PNG for browsers that do not support SVG favicons at all.
Q2: What file format is best for dark mode favicons?
For maximum compatibility, you should use PNG for your favicons. The ICO format is still supported but often results in larger file sizes and does not support modern features like transparency well at all sizes. PNG is smaller, supports full transparency, and is understood by every modern browser. For the highest quality at small sizes, generate a PNG at 16×16, 32×32, 48×48, and 96×96 pixels. Some tools also produce SVG favicons, but SVG support for favicons is still not universal (especially on older browsers). For the dark mode variant, PNG is the safest choice. If you want to include a mask‑icon for Safari, use a separate solid‑color SVG file with rel="mask-icon".
Q3: Do I need to provide a favicon for every size listed in the HTML?
Not necessarily, but including a few key sizes improves performance and appearance across devices. The most critical size is 32×32 for desktop browser tabs. Also important are 16×16 (for bookmarks and the address bar in some browsers), 180×180 (for Apple touch icon on iOS home screen), and 192×192 (for Android Chrome). When you provide a range of sizes, the browser picks the most appropriate one for the context. Tools like RealFaviconGenerator will automatically generate and link all required sizes. If you are manually coding, at minimum include 32×32 and 180×84 or 180×180 (with rel="apple-touch-icon"). For dark mode, you only need to duplicate the same set of sizes for the dark variant, but you can get away with just a 32×32 dark version if you are short on time.
Q4: How do I test if my dark mode favicon is working correctly?
The simplest method is to open your website in a browser and toggle your system’s colour scheme between light and dark. In Chrome, you can also open DevTools (F12), go to the Rendering tab, and under “Emulate CSS media feature prefers-color-scheme” choose “dark” or “light”. This will immediately swap the favicon if your HTML is set up correctly. For Firefox, use the Responsive Design Mode (Ctrl+Shift+M) and click the device settings icon to toggle the theme. Safari does not provide an easy emulation; you must change the system appearance in System Preferences. Additionally, you can use online favicon checkers such as Favicon Checker or the RealFaviconGenerator tester to see all icons that your page is serving. Remember to clear the browser cache or use a versioned URL to avoid seeing a stale favicon.
Q5: Can I use dark mode favicons with a Content Management System like WordPress?
Absolutely. Most CMS platforms allow you to upload a custom favicon, but they typically only expose one field. To add a dark mode favicon, you will need to manually insert the extra <link> tag into the <head> of your theme. In WordPress, you can do this via a child theme’s functions.php file using add_action('wp_head', 'your_function'); or by editing the header.php template. Many SEO plugins (like Yoast or Rank Math) also inject a basic favicon, but they do not support dark mode out of the box; you will need to override them. For modern WordPress Gutenberg themes, you can sometimes use the “Custom HTML” block in the head section. Always ensure that the dark mode favicon path is correct and that you include the media attribute. Tools like RealFaviconGenerator can export a block of HTML that you can paste directly into your header.
Q6: What should I do if my favicon is not updating after I change it?
Favicons are notoriously cached by browsers. Even after you update the file on your server, users may see the old icon for days or weeks. To force an update, you can append a query string to the favicon URL, e.g., favicon-light.png?v=2. This tricks the browser into treating it as a new resource. Additionally, you can clear your own browser cache, open a private/incognito window, or use a “cache busting” technique in your build pipeline. For dark mode specifically, if you change the dark variant, apply the same versioning to that URL. Also, note that some browsers (particularly Safari) cache the favicon in a system‑level cache that is harder to clear; in that case, restarting the browser or using a different device for testing might be necessary.
Conclusion
Creating a favicon that gracefully adapts to dark mode is no longer an optional nicety—it is a fundamental aspect of modern web design that directly impacts user perception and brand consistency. By leveraging the tools and techniques covered in this guide, you can ensure that your favicon remains visible, recognizable, and professional whether your visitor is browsing in a sunlit room or a dark office at midnight. We started by understanding the underlying HTML mechanism that makes dark mode favicons possible, then walked through six concrete steps using tools ranging from the all‑encompassing RealFaviconGenerator to command‑line automation with Sharp. We also explored best practices such as using transparent backgrounds, simplifying icon design, and paying attention to Safari’s mask‑icon. The two reference tables provide a quick comparison of tool capabilities and browser support, helping you make informed decisions. Finally, the FAQ section addressed common pitfalls and practical solutions. With this knowledge, you are now equipped to implement a flawless favicon experience that delights users in any colour scheme. Start by choosing a tool that fits your workflow, design your two variants, test thoroughly, and then enjoy the confidence that comes with a truly modern favicon strategy.