How to Create a Favicon for Your Website

How to Create a Favicon for Your Website

A favicon is the small square icon that stands for your website in a browser tab, in bookmarks, and next to your listing in Google Search results. The short answer: make one square image of your logo, at least 512 by 512 pixels, turn it into a small set of files, and add four lines to the head of your pages. The rest of this guide walks through each step, including the sizes Google asks for, the Apple home screen icon, and what to do when the new icon refuses to show up.

What a Favicon Is and Where It Shows Up

The word favicon is short for favourite icon. It is the tiny picture that helps people find your site again without reading anything. Open ten tabs and you will see what it does: the tab with your site is the one with your mark on it, not a blank page icon. The same icon shows up in bookmarks, in the browser history list, and on a phone home screen when someone saves your site there. Google can also show it next to your site name in search results, which is the one place where it meets people who have never visited your site.

A favicon is about recognition, not ranking. It does not make your pages rank higher. It makes your site recognisable where a visitor is choosing between several open tabs or several search results. A site with no favicon gets the browser default, a blank document icon, and that looks unfinished next to every other site that has one.

Three facts worth knowing before you start. If a page has no icon link at all, browsers still ask the server for a file called favicon.ico at the site root, which is why server logs often show 404 errors for that file on sites that never made one. One ICO file can hold several sizes at once, usually 16, 32, and 48 pixels, and the browser picks the size it needs. And an SVG favicon can change colour for dark mode, because the file itself can contain a media query.

What Size and Format Your Favicon Should Be

There is no single favicon size. Different places ask for different sizes, so the practical answer is a small set of files made from one master image. Start with a square master of your logo at 512 by 512 pixels, on a plain background, and generate everything else from it. A 512 pixel master is large enough for every size in the set and small enough to work with in any image editor.

Google has its own rules for the icon it shows in search results. Its documentation says the favicon must be square, at least 8 by 8 pixels, and it recommends using one larger than 48 by 48 pixels so it looks good on different surfaces. Google lists seven supported formats for search: BMP, GIF, ICO, PNG, JPEG, PPM, and TIFF. SVG and WebP are not on that list, which matters more than it first seems. An SVG favicon works fine in a browser tab, but Google Search will not pick it up, so you need a PNG or ICO file linked alongside it for search.

The full set looks like this:

File Size Where it shows How to link it
favicon.ico 16, 32, and 48 pixels in one file Browser tabs, bookmarks, older browsers, feed readers <link rel="icon" href="/favicon.ico" sizes="32x32">
favicon.svg Any size, it is a vector Tabs in modern browsers, sharp at every size <link rel="icon" href="/favicon.svg" type="image/svg+xml">
favicon-32x32.png 32 by 32 pixels Tab icon fallback, and the file Google picks up for search <link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png">
apple-touch-icon.png 180 by 180 pixels iPhone and iPad home screen <link rel="apple-touch-icon" href="/apple-touch-icon.png">
icon-192.png 192 by 192 pixels Android home screen and installable web apps Listed in the web app manifest
icon-512.png 512 by 512 pixels App install screen and splash screen Listed in the web app manifest

You do not need a separate file for every size ever invented. This set covers tabs, search results, Apple devices, and Android. If you only make one file, make it a 32 by 32 PNG, because that is the safest single default for a browser tab. But the whole set takes only a few minutes with a generator, and it removes the cases where a device falls back to a screenshot or a blank icon.

How to Design a Favicon That Stays Readable at 16 Pixels

A favicon is judged at its smallest, not its largest. In a browser tab it appears at roughly 16 pixels wide, which is about the width of two letters of this text. A detailed logo with small text, thin lines, or several colours turns into a smudge at that size. Design for the tab first and the larger sizes will take care of themselves.

Use one bold shape. A single letter, a simple mark, or one recognisable symbol works. If your logo is a wordmark, use its first letter or its most distinct shape, not the whole word. Keep the background solid and simple. A favicon with a transparent background can look fine in a tab, but on some surfaces the transparency is filled in, so a solid brand colour is the safer choice. Use two or three colours at most, with strong contrast between the mark and the background. Avoid thin outlines, small text, and gradients that fade to nothing, because all three disappear at 16 pixels.

Test the design before you ship it. Shrink your image to 16 by 16 pixels and look at it next to other tabs. If you cannot tell what it is in one second, simplify it further. Then check it on a dark browser theme if your mark is dark. A white mark on a transparent background vanishes on a dark tab bar, and a coloured background square fixes it.

Worked Example: From One Logo to a Full Favicon Set

Say you run a small bakery website called Crumb and Craft, and your logo is a simple wheat stalk in cream on a warm brown square. Here is the whole job, start to finish, in about fifteen minutes.

Step 1: Make the master. Export the wheat mark as a square PNG at 512 by 512 pixels. Keep the mark large, filling about 70 percent of the square, with the brown background reaching every edge. Do not round the corners yourself. Phones and browsers apply their own rounding, and pre-rounded corners end up looking doubled.

Step 2: Generate the set. Upload the master to the Favicon Generator and generate the full set: the multi-size ICO file, the SVG, the 32 pixel PNG, the 180 pixel Apple touch icon, and the 192 and 512 pixel app icons. Check that every file is square. If you work with photos or other images elsewhere on the site, the same habit applies: pick the right format first, then resize. Our guide to PNG vs JPG vs WebP explains when each format is the right choice.

Step 3: Check the small sizes. Open the 32 pixel PNG and the 16 pixel version inside the ICO file. The wheat stalk should still read as a wheat stalk, not a brown blob. If the thin lines of the stalk vanish, go back to the master and thicken them, then regenerate. This is the step most people skip, and it is the step that decides whether the favicon works.

Step 4: Upload and link. Put the files at the root of the site, add the link lines to the head of your pages, and test in a fresh browser tab. The bakery is only an example, but the steps are the same for any site: one master, one generated set, one check at the smallest size.

How to Add the Favicon to Your Website

Adding a favicon means telling the browser where the files are. That is done with link elements in the head section of each page. The standard link uses rel equals icon, and MDN documents this as the way to declare a site icon. The sizes attribute tells the browser which size the file holds, and the type attribute states its format, so the browser can pick the best match it supports.

Paste these four lines into the head of your pages, adjusting the file names if yours differ:

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

Use paths that start from the site root, with a leading slash, rather than relative paths. A relative path breaks on deeper pages, so a visitor on yoursite.com/blog/post would look for the icon in the blog folder instead of the root. The ICO file at the root also covers the automatic request browsers make when no link is present, so keep that file in place even if you link everything else explicitly.

If your site runs on WordPress, the Site Identity section in the Customizer accepts a site icon and writes these links for you. That is the easiest route. If you edit the theme files directly instead, back the file up first and add the lines just before the closing head tag. One warning from MDN is worth knowing: if your site uses a Content Security Policy, the policy applies to the favicon too, and a favicon that will not load is often blocked by the img-src rule, not by a missing file.

How to Add the Apple Touch Icon and App Icons

The Apple touch icon is separate from the tab favicon. It is the icon Safari shows when someone saves your site to the home screen on an iPhone or iPad. Apple documents it as a PNG file called apple-touch-icon.png placed in the root folder of the site, with an optional link element for a page-specific icon. The size to ship is 180 by 180 pixels. Apple shows examples at 152, 167, and 180 pixels in its documentation, and the device picks the most appropriate size. A single 180 pixel file serves current iPhones and iPads, because iOS scales it to what each device needs.

Give the touch icon a solid background. iOS does not treat transparency the way a browser tab does, and a transparent area can end up filled with black on the home screen. Keep the artwork away from the edges, because iOS rounds the corners itself. If no touch icon is provided, iOS falls back to a small screenshot of the page, which usually shows unreadable text and whatever banner was on screen, so this one file is worth the minute it takes.

For Android and installable web apps, the icons live in a web app manifest, a small JSON file linked from the head. The web.dev guide to manifests says that for Chromium you must provide at least a 192 by 192 pixel icon and a 512 by 512 pixel icon. Chrome scales those two to fit the device if nothing else is provided. Add a separate maskable icon if you want Android to crop the icon into its own shapes without cutting off your mark. A maskable icon is a full-bleed square with the important artwork kept inside the central safe area, and it is declared with purpose set to any maskable in the manifest. The manifest itself is linked with one line:

<link rel="manifest" href="/manifest.json">

You only need the manifest if your site is meant to be installed as an app. A plain website with no install feature does fine with the tab favicon and the Apple touch icon alone. If you shrink images for the web anywhere in this process, our guide on how to shrink an image for the web covers keeping small images sharp, which is the same skill at a different size.

How to Get Your Favicon Into Google Search Results

Google can show your favicon next to your site name in search results, but it has its own requirements, and meeting them is a separate step from making the icon appear in a browser tab. The rules come from Google Search Central, and they are short enough to check one by one.

Requirement What Google says What to do
Shape and size Square, at least 8 by 8 pixels, larger than 48 by 48 recommended Make the master 512 by 512 pixels and export a PNG of 48 pixels or larger
Format BMP, GIF, ICO, PNG, JPEG, PPM, and TIFF are supported Link a PNG or ICO for search. An SVG alone will not be picked up
One per hostname One favicon per site, where a site is defined by the hostname Subdomains can have different icons, subdirectories cannot
Crawlable Googlebot must be able to crawl the home page and the favicon file, and neither may be blocked by robots.txt Check robots.txt, then request indexing of the home page in Search Console
Stable URL The favicon URL must be stable and should not change frequently Pick the file name once and keep it. Do not rename it on every redesign
Representative The favicon should visually represent the brand Use your own mark, not a generic symbol or a stock icon

Two points in that list catch people out most often. The first is the format list: older guides still quote a rule that the favicon must be a multiple of 48 pixels, such as 48, 96, or 144. That was Google’s old wording. The current page says square, at least 8 by 8, with larger than 48 by 48 recommended. If a guide you are reading insists on exact multiples of 48, it is out of date.

The second is timing. Adding the link tag does not make the icon appear in search results the same day. Google has to recrawl your home page and process the change, and its own documentation says crawling can take anywhere from several days to several weeks. You can ask for the home page to be recrawled in Search Console, but there is no way to force an instant update, and even a fully correct favicon is not guaranteed to appear. If it does not show after a few weeks, recheck the list above before changing anything, because changing the file name restarts the wait.

How to Fix It When Your Favicon Does Not Show Up

A favicon that does not appear is almost always one of a short list of causes, and they are quick to check in order. Start with the simplest one: the browser cache. Browsers cache favicons aggressively, so the old icon, or the blank default, can survive long after the file changed. Open the site in a private window, or hard refresh the page, and check whether the new icon appears there. If it does, the file is fine and only your browser needed to let go of the old one.

Next, open the icon file directly in the browser by typing its full address, for example yoursite.com/favicon.ico. If that returns a 404 page, the file is not where the link says it is, or the upload went to the wrong folder. If the file opens fine, the problem is in the link. Check that the href matches the real file name exactly, including capital letters, and that the path starts from the root with a leading slash.

Then check the file itself. An icon that is not square will be rejected by Google and may be ignored by browsers. A file saved with a PNG extension that is actually a JPEG, or a file renamed to .ico that is still a PNG, causes the same confusion. Open the file in an image editor and confirm its real format and its dimensions. If you converted images for this job, our guide on converting images to WebP explains how formats and extensions can quietly disagree.

If the tab icon works but Google Search still shows the default after several weeks, check the search requirements again: the linked PNG or ICO file, the crawlable home page, and the robots.txt file. A single Disallow line that blocks the icon folder is enough. Fix the cause, keep the file name the same, and wait for the next recrawl.

Frequently Asked Questions

Do I Need a Favicon if My Site Is Small?

Yes. Size does not change the job the icon does. A small site has the same tabs, bookmarks, and search listings as a large one, and the blank default icon is just as visible. It takes about fifteen minutes with a generator, and it is one of the cheapest ways to make a site look finished.

Why Does My Favicon Still Show the Old One?

Browsers and Google both cache favicons for a long time. Your browser may hold the old icon for days even after the file changed, and Google Search may take days to weeks to recrawl the home page. Check the new file in a private window first. If it shows there, the file is correct and only the caches need time. Do not rename the file to force it, because a new name restarts Google’s wait.

Can I Use an Emoji as My Favicon?

You can. An SVG file containing a single emoji character works as a favicon in modern browsers, and it is a popular shortcut for a personal site or a quick project. Keep a PNG fallback linked alongside it for older browsers and for Google Search, which does not accept SVG. For a business site, a real brand mark is still the better choice, because an emoji says nothing about who you are.

Should My Favicon Be an SVG or a PNG?

Use both. The SVG is the sharpest tab icon in current browsers and scales to any size from one file. The PNG, or the ICO file, is what Google Search accepts and what older browsers fall back to. Link the SVG first for modern browsers and keep the PNG or ICO linked beside it. That combination covers tabs, search results, and older browsers at once.

Does a Favicon Help My Google Ranking?

No. A favicon does not change where your pages rank. It changes how your site looks in the places where people choose what to open, which is a browser tab, a bookmark list, or a search results page. That recognition is worth having, but it is not a ranking factor, and no favicon will rescue pages that do not deserve to rank.

Sources