Web Development

How to Add a Favicon to Your Website

Written by Muhammad Naeem15 min readUpdated for 2026
Close-up of a laptop screen showing a web browser with several tabs open
A laptop screen showing a web browser with tabs open at the top — the favicon is the small icon at the left of each tab. Stock photo from Pexels (photo 3585032, free to use under the Pexels licence).

Open ten tabs in your browser and look along the top of the window. The sites you recognise instantly — your email, your favourite shop, the search engine you use every day — all have a tiny picture next to their name. That picture is the favicon, and it is one of the smallest branding elements on your website. It is also one of the most-seen: it appears every time someone has your site open, saves it as a bookmark, or finds it in search results.

Many small business websites still show the browser's default blank-page icon, or no icon at all. It takes only a few minutes to fix, and it makes your site look finished and professional. This guide explains what a favicon is, where it appears, what sizes and formats you need, and the three practical ways to add one — by placing a file in your site root, by adding a link tag to your HTML, or through your WordPress dashboard.

What Is a Favicon?

A favicon, short for “favorite icon”, is a small image file that represents your website in the browser. When someone visits your site, the browser downloads the favicon and shows it next to your page title. It is not part of the page content itself — it lives in your site's files and is declared in the page head, or simply placed at the root of your site where browsers know to look for it.

The idea dates back to Internet Explorer 5, released in 1999, which showed a site's icon next to bookmarked pages. Browsers have supported favicons ever since, and today every major browser — Chrome, Firefox, Safari, and Edge — displays them. The name has stuck even though favicons now appear in far more places than the old favourites menu.

Think of the favicon as your website's smallest logo. At 16 by 16 pixels it is barely bigger than a fingernail on screen, yet it is often the first thing a returning visitor looks for when scanning a row of open tabs. A site with a favicon looks established; a site with a blank default icon looks unfinished, even if the design underneath is excellent.

Where Your Favicon Appears

Before choosing or designing an icon, it helps to know everywhere it will show up. The most familiar place is the browser tab: the favicon sits to the left of the page title, and when many tabs are open and the titles are cut off, the icon is often the only way to tell tabs apart. That is why a distinctive shape and colour matter more than fine detail.

Your favicon also appears in bookmarks and the bookmarks bar, in the browser history list, and in the address bar suggestions that appear as you type. On phones, it shows when someone saves your site to their home screen, and it appears in the list of recently visited sites on the new-tab page. Google may also show your favicon next to your pages in search results, where a recognisable icon can make your listing stand out among ten blue links.

Because the same file is reused in all of these places, at sizes from 16 pixels up to 180 pixels and beyond, one well-made icon does a surprising amount of work. It is worth getting right rather than uploading the first square image you find.

What Makes a Good Favicon

The first rule of favicon design is simplicity. At 16 by 16 pixels, a detailed photograph or a full logo with small text turns into an unrecognisable smudge. The best favicons are a single bold shape: the first letter of your brand, a simple symbol, or a simplified version of your logo mark. If your logo is a wordmark, do not shrink the whole word — pick one letter or one element from it.

Contrast is the second rule. Your icon will sit on light and dark browser themes, on white bookmark bars and dark new-tab pages. A mid-tone grey mark on a transparent background can disappear on some of these. Test your design on both a white and a dark background before publishing, and consider giving the icon a solid background in your brand colour so it stays visible everywhere.

The third rule is consistency. Your favicon should match the logo people already see on your website and your social profiles. If your site header shows a blue hexagon and your favicon is a red circle, visitors will not connect the two. Keep the same mark, the same colours, and the same proportions. A favicon is not the place for a second logo — it is the smallest version of the one you already have.

The Sizes and Formats You Need

Favicons come in several sizes because they are displayed in several places. The classic tab icon is 16 by 16 pixels, and browsers also use a 32 by 32 version on high-density screens and in the taskbar. Google asks for a favicon of at least 48 by 48 pixels if it is to show your icon next to your pages in search results, so 48 is a sensible minimum to provide.

Phones add two more sizes. Apple devices use a 180 by 180 pixel “apple touch icon” when someone saves your site to their home screen, and Android devices use 192 by 192 and 512 by 512 pixel icons for the same purpose. You do not need to create each of these by hand — a single square source image at 512 by 512 pixels can be resized into all of them by your site platform or by a favicon generator.

For formats, three are in common use. ICO is the oldest format and the only one that can hold several sizes inside a single file; it works in every browser, including older ones. PNG is supported by all modern browsers and is easier to create from a design tool. SVG is a vector format, so it stays sharp at any size, and modern browsers support it as a favicon — but older browsers do not, so it should be an addition to an ICO or PNG file, not a replacement for one. A practical setup is a favicon.ico file plus a 180 pixel PNG for Apple devices, with an SVG added if your site already uses one.

How to Create Your Favicon

Start from your logo, not from scratch. Open the logo in a design tool such as Figma, Canva, or Photoshop, and export a square version at 512 by 512 pixels. If your logo is wide rather than square, place the mark — not the full wordmark — in the centre of the square, with a little padding around it. Padding matters: an icon that touches the edges of its square looks cramped when it is shrunk to tab size.

If you do not have a logo file, a simple lettermark works well: one or two letters of your business name in a bold font, on a solid background in your brand colour. Many businesses use exactly this. Keep the background solid rather than transparent for your first version — it is easier to see on every browser theme, and you can refine it later.

Once you have the square PNG, convert it to the formats you need. A free favicon generator website can take your PNG and produce a favicon.ico file plus the resized PNGs for Apple and Android in one step — search for “favicon generator” and pick one that lets you download the files rather than one that asks you to sign up. Whichever route you take, check the result at 16 pixels before you publish it. Zoom out, or open the file at its real tab size: if you cannot tell what it is, simplify the design and try again.

Method 1: Put favicon.ico in Your Site Root

The oldest and simplest method is to place a file called favicon.ico in the top-level folder of your website — the same folder that holds your homepage. Most browsers automatically request /favicon.ico when they load any page on your site, so this method works even before you edit any HTML. If your site is built with a framework such as Next.js, the equivalent folder is usually called public; if it is a plain HTML site, it is the folder your index.html sits in.

The file must be named exactly favicon.ico, all lowercase, and it must be a genuine ICO file — not a PNG that has simply been renamed. If you only have a PNG, use a favicon generator or a converter to produce a real ICO file first. Upload it, then open your site in a new browser tab and look at the tab: the icon should appear within a few seconds.

This method covers the tab icon and bookmarks in most browsers, but it does not provide the larger sizes phones want for home-screen shortcuts. For a complete setup, combine it with the link tags in the next section, which point browsers to the extra sizes.

Method 2: Add a Link Tag to Your HTML

The explicit method is to declare your favicon in the head section of each page, using link tags. This gives you full control: you can point browsers to a PNG or SVG file, offer several sizes, and add the Apple touch icon. Add the following lines inside the <head> section of your page, adjusting the file names to match the files you uploaded:

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

Each line tells the browser where to find one version of the icon. The first line is the classic ICO file. The second offers a crisp 32 pixel PNG for modern browsers. The third is the SVG version, which stays sharp at any size. The fourth is the Apple touch icon, used when someone saves your site to an iPhone or iPad home screen.

Where you add these lines depends on how your site is built. On a plain HTML site, they go in the head of each page, or in a shared header file if your pages include one. In a framework such as Next.js, they belong in the root layout or metadata configuration. In a WordPress theme, they go in the theme's header template — though if you use WordPress, the dashboard method in the next section is usually easier. After adding the tags, upload the four files to your site root and test in a fresh browser tab.

Adding a Favicon in WordPress

WordPress includes a built-in setting for the site icon, so you can add a favicon from the dashboard. In your WordPress admin, go to Appearance, then Customize, then Site Identity. There you will find the Site Icon setting. Upload a square image of at least 512 by 512 pixels — your logo mark or lettermark works well — and WordPress will generate the sizes it needs, including the Apple touch icon, and add the link tags for you.

If you use a block theme with the newer Site Editor instead of the Customizer, the same setting lives under Appearance, then Editor, then the site identity area — the name of the setting is still Site Icon. Either way, publish the change and then check your site in a new tab. WordPress also uses the same image as the icon for your admin bar, so you will see the result there too.

One thing to watch: some WordPress themes and plugins add their own favicon tags, and a caching plugin may serve an old version of your pages. If the new icon does not appear after you save, clear your site cache from the caching plugin's settings and try a hard refresh in the browser before assuming something is wrong.

How to Test That Your Favicon Works

Testing a favicon is quick, but browsers cache favicons aggressively, so a careless test can mislead you. Start with a hard refresh: on Windows press Ctrl and F5 together, on a Mac press Command, Shift, and R. Then open your site in a private or incognito window, where the cache is empty, and look at the tab. If the icon appears there, it is working — your normal window is simply showing the cached version.

Check more than the tab. Bookmark the page and look at the bookmark entry, then open your browser history and find the visit. On your phone, save the site to your home screen and check the icon that appears. Each of these reads a different size of the icon, so a problem that only affects one of them points to a missing size rather than a broken setup.

For a technical check, open your browser's developer tools, go to the Network tab, reload the page, and look for the favicon request — it should return a 200 status, not a 404. There are also free favicon checker tools online that fetch your site and report which icon files they find and which sizes are missing. Run one after you publish, and fix whatever it flags before moving on.

Common Favicon Mistakes to Avoid

The most common mistake is the wrong file path. A link tag that points to /images/favicon.ico will fail if the file actually sits in /favicon.ico, and a relative path such as favicon.ico can break on pages that live in subfolders. Use a path that starts with a slash, which always means “from the root of the site”, and confirm the file loads by opening its address directly in the browser.

The second mistake is providing only one tiny size. A single 16 by 16 file looks fine in a tab but blurry or missing everywhere else — in search results, on a phone home screen, and in bookmarks. Provide the 48 pixel size for search, the 180 pixel Apple touch icon, and a 512 pixel source, even if you generate the rest from it automatically.

The third mistake is using a detailed image. A photograph, a logo with a tagline, or a mark with thin lines all turn to mush at 16 pixels. If your logo does not survive being shrunk, simplify it for the favicon rather than forcing the full version in. And finally, do not expect instant results: after you replace a favicon, some browsers keep showing the old one for hours or days because of caching. That is normal. Test in a private window, and give returning visitors time to pick up the new version.

Conclusion

A favicon is a small file with an outsized effect. It helps visitors find your site among their open tabs, recognises your brand in bookmarks and search results, and signals that the site is finished and cared for. The work itself is short: design a simple, high-contrast mark, export it at 512 pixels square, generate the ICO and PNG versions, and either place favicon.ico in your site root or add the link tags to your page head. WordPress users can do the same from the Site Identity setting. Test in a private window, check the bookmark and home-screen views, and remember that caching can delay the change for returning visitors. Once it is in place, you will wonder why the site ever went without one.

Frequently Asked Questions

What size should a favicon be?

Provide several sizes: 16 by 16 and 32 by 32 pixels for browser tabs, at least 48 by 48 pixels so Google can show it in search results, 180 by 180 pixels for Apple home-screen icons, and a 512 by 512 pixel source image that the other sizes can be generated from.

What file format is best for a favicon?

ICO is the safest choice because every browser supports it and one file can hold several sizes. PNG works in all modern browsers and is easier to create. SVG stays sharp at any size in modern browsers, but older browsers do not support it, so use it alongside an ICO or PNG file rather than instead of one.

Why is my favicon not showing?

The usual causes are browser caching, a wrong file path in the link tag, or the file not being where the tag points. Try a hard refresh (Ctrl+F5 on Windows, Command+Shift+R on Mac), open the site in a private window, and open the favicon address directly in the browser to confirm it loads with a 200 status.

Can I use a photo as a favicon?

You can, but it rarely looks good. At 16 by 16 pixels, the detail in a photograph disappears and the result looks like a blurry coloured square. A simple shape, letter, or simplified logo mark works far better at favicon sizes.

Does a favicon help SEO?

A favicon is not a direct ranking factor, so adding one will not move your pages up the results by itself. It helps indirectly: Google may show your icon next to your listings, which makes them easier to recognise, and a recognisable icon in tabs and bookmarks brings visitors back to your site.

How do I change my favicon later?

Replace the icon files on your server with the new versions, keeping the same file names if you can, and update the link tags if the names changed. Then test in a private window. Returning visitors may keep seeing the old icon for a while because browsers cache favicons, so allow a day or two for the change to spread.

Need a Favicon and a Website That Stands Out?

Naeem WebStudio designs fast, professional websites with complete branding — including a favicon that makes your site recognisable in every tab, bookmark, and search result. Tell us what your website needs.

WhatsApp: 03207140898Send Email Inquiry

Explore More Resources & Services:

Image Optimization Guide: Speed Up Your Site | Naeem Web StudioHow to Add Schema Markup to Your Website (2026 Guide)On-Page SEO Guide: 14 Elements to Optimize | Naeem Web StudioWebsite Maintenance Checklist (2026) | Naeem Web StudioWebsite Speed & Conversions: Why Speed Matters | Naeem Web StudioHow to Choose the Right Web Developer | Naeem Web Studio
Chat with Naeem