Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Favicons

How to Add a Favicon to an HTML Page (With Troubleshooting)

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Add a favicon by placing an icon file where your site serves it, then adding a <link rel="icon"> element inside the page’s <head>. For a conventional site-root icon, use:

<link rel="icon" href="/favicon.ico" type="image/x-icon">

The URL in href must resolve to the deployed image. The rest of this guide covers formats, paths, multiple sizes, progressive web app manifests, verification, and fixes when the icon does not appear.

The smallest working example

Create an icon file, such as favicon.ico, in the directory your web server exposes at the site root. Then add the link in every HTML document that should use it:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Example page</title>
  <link rel="icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
  <h1>Example page</h1>
</body>
</html>

rel="icon" identifies the linked resource as the document icon. The element belongs in <head>, not in the page body.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

What the path means

  • /favicon.ico is root-relative: it starts at the website’s top-level directory, regardless of how deeply nested the current page URL is.
  • images/favicon.svg is document-relative: the browser resolves it from the current document URL.
  • /images/favicon.svg is root-relative and points to an images directory at the site root.

If a file named /favicon.ico is available at the root, many browsers and other software look for it automatically even without a link element. An explicit link is still the reliable choice when the file has another name, format, or location.

Choose an icon format

ICO, PNG and GIF are established favicon formats. SVG is also commonly usable when the browsers and contexts you support accept it. Match the type value to the actual file format, and do not rename a file without converting it.

Format Example link Useful when
ICO <link rel="icon" href="/favicon.ico" type="image/x-icon"> You want the conventional root-level fallback and broad legacy coverage.
PNG <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> You have a raster icon at a known pixel size.
GIF <link rel="icon" type="image/gif" href="/favicon.gif"> Your target browser and design specifically use a GIF asset.
SVG <link rel="icon" type="image/svg+xml" href="/favicon.svg"> You need a scalable asset and have confirmed SVG support in your target contexts.

Offer several sizes

When more than one icon link is present, browsers can use media, type and sizes as selection hints. A typical PNG set looks like this:

<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="192x192" href="/favicon-192x192.png">

The dimensions in sizes should describe the delivered file. They are hints for choosing among resources, not instructions to resize a low-resolution image into a sharper one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Put the asset in the right deployment directory

Local project folders and public URLs are not always the same. A framework may expose a public or static directory at the web root. If you place favicon-32x32.png in that directory and deploy it unchanged, the public URL may be /favicon-32x32.png. Confirm the framework’s static-asset rule rather than guessing from the source-tree path.

  1. Identify the URL you want, for example https://your-domain.example/favicon.ico.
  2. Place the file in the directory that publishes that URL.
  3. Use the same URL, including capitalization and extension, in href.
  4. Deploy the file and HTML together, or deploy the asset first so the link never points to a missing resource.

On a case-sensitive server, Favicon.ico and favicon.ico are different files. Keep the filename in the HTML exactly aligned with the deployed filename.

Keep a normal favicon separate from PWA icons

A document favicon covers tabs, bookmarks and similar browser interface locations. A progressive web app uses a web manifest as well:

<link rel="manifest" href="/app.webmanifest">

The manifest’s icons entries require src and may include sizes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "icons": [
    {
      "src": "/icons/icon-192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "/icons/icon-512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

Manifest icons support installation, splash screens and operating-system contexts; they supplement rather than replace the ordinary <link rel="icon">. A relative src in the manifest resolves against the manifest URL, so moving the manifest can change where that icon is expected.

Verify the favicon before blaming the browser

  1. View the deployed page source or DOM and confirm the icon link is inside <head> with rel="icon".
  2. Copy the exact href URL and open it directly. You should receive the image rather than a 404 page or an HTML error document.
  3. Inspect the network response and confirm the server returns an image content type that matches the file, such as image/png, image/gif, image/x-icon or image/svg+xml.
  4. Test a page in a subdirectory. If it fails there but works at the homepage, replace a document-relative path with a root-relative one when the asset is at the site root.
  5. If you are testing an installed PWA icon, inspect the manifest and its icon URLs separately from the ordinary favicon link.

Use the final production hostname during this check. A correct file on a development origin does not prove that the production server, CDN or deployment directory serves the same path.

Common favicon problems and fixes

The icon link is outside the head

Symptom: The markup contains a link, but browsers ignore it. Fix: Move the element into the document’s <head> and keep rel="icon" on the element.

The URL returns 404 or an HTML page

Symptom: Opening the href directly shows an error or a normal webpage. Fix: Correct the filename, capitalization and deployment directory. Then verify the exact public URL again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

A nested route looks in the wrong folder

Symptom: The homepage shows an icon but /docs/setup does not. Fix: Use /favicon.ico or another root-relative URL when the asset lives at the site root. A path such as images/favicon.png is resolved relative to the current document URL.

The content type does not match

Symptom: The file exists, but the browser does not treat it as an icon. Fix: Configure the server to return an image content type matching the actual format, and make the link’s type value agree with it.

The PWA install icon is wrong while the tab icon is right

Symptom: The browser tab uses the intended favicon, but an installed app uses another image or none. Fix: Check the manifest link, each manifest src, and the manifest-relative path resolution. PWA installation uses manifest icons, not only the document favicon.

An old icon remains during testing

Symptom: Source and network responses are correct, but the browser interface still displays an earlier image. Fix: Perform a hard reload, close and reopen the affected tab, and test in a private window. If the old result persists, inspect the browser’s stored site data and any caching layer serving the asset.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a rendered check of a deployed page rather than a local browser workflow, ScreenshotNeo is the first service to try: it removes consent clutter before capture, bills only clean shots, and its paid plan starts at $5 for 3,000 shots. Give it the URL of the page whose favicon you want to inspect.

See the ScreenshotNeo API documentation for authentication and options. This cURL request saves a WebP screenshot:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Replace the example URL with your deployed page URL. The same request in Python is:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

Before the shot, ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers identify the page verdict and whether it was billed. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to check your deployed page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Practical checklist

  • An icon file is deployed at the URL used by href.
  • The link is inside <head> and uses rel="icon".
  • The path is root-relative when the asset is at the site root.
  • The declared type and server content type match the real format.
  • Multiple files have accurate sizes values.
  • A PWA manifest is linked and tested separately when installation support is required.

Frequently Asked Questions

Does the sizes attribute change an icon’s pixel dimensions?

No. It tells the browser which intrinsic size each linked file provides so it can choose among resources; it does not sharpen or upscale the image.

Can the favicon link and manifest point to different artwork?

Yes. They serve different contexts: the favicon identifies the document in browser UI, while manifest icons serve installation, splash-screen and operating-system contexts.

Why can a favicon work on the homepage but not on a deeper URL?

A document-relative href is resolved from each page URL. A root-relative path is usually appropriate when the same asset is stored at the site root.

The Bottom Line

Deploy the icon, reference its exact public URL with <link rel="icon"> in <head>, and verify both the file response and the path from a nested page. Add manifest icons separately when you support PWA installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.