New Tool Radar

AI Design Workflows

How to Check a Favicon Before You Publish a Site

Before you publish a site, check the favicon at 16 by 16 pixels and on light and dark backgrounds, so the mark stays readable everywhere it shows.

Schematic diagram: three steps to check a favicon — link the files, read it at 16 by 16, try light and dark — with a practice result of 3 of 5 checks passing and 2 failing.

Before you publish a site, check the favicon at 16 by 16 pixels and on light and dark backgrounds, so the mark stays readable everywhere it shows. Open the site in a tab, shrink the icon to its smallest size, and switch the browser between light and dark. Two checks on the practice site fail: the full wordmark is unreadable at 16 by 16, and the dark-green mark vanishes on a dark tab background.

MDN shows the declaration: “For example, a link to the site’s favicon: <link rel=“icon” href=“favicon.ico” />” It adds: “The sizes attribute indicates the icon size, while the type contains the MIME type of the resource being linked. These provide useful hints to allow the browser to choose the most appropriate icon available.”

Schematic diagram: three steps to check a favicon — link the files, read it at 16 by 16, try light and dark — with a practice result of 3 of 5 checks passing and 2 failing.

What counts as passing

A favicon is declared with a link element: rel=“icon” names the relationship, href gives the file, sizes gives the icon size, and type gives the MIME type. MDN says the sizes and type attributes “provide useful hints to allow the browser to choose the most appropriate icon available”. An ICO file can store several sizes at once, and an SVG favicon uses sizes=“any” because it can be scaled to any size. A favicon passes this guide when the browser can pick a file for the size it needs, the mark reads at the smallest size, and the mark reads on both light and dark backgrounds.

Light and dark is a separate check from size. MDN says a media attribute on the link means the resource “will then only be loaded if the media condition is true”, so one icon can be served for a light background and another for a dark one. A single dark mark on a dark tab fails even when the file itself is perfect, and a detailed wordmark fails at 16 by 16 even when it looks fine at 512 by 512. This guide checks the mark as the reader will actually see it: small, and on both backgrounds.

The practice design and the check table

Use a fictional cafe site for the exercise. The fictional brand is Maple Corner, a small cafe at 12 Maple Lane that does not exist. Five checks were made on its favicon set, and each row below is one check as carried out. Nothing in the table comes from a real client site.

How the table was worked out

Each check was judged on what the reader sees: can the browser pick a file for the size it needs, can the mark be read at 16 by 16 pixels, and can it be read on a light background and on a dark one? A check passes when the mark stays readable. A check fails when the mark cannot be read, or when no file is offered for that case.

Check What the site supplies Result
favicon.ico One file holding 16, 32, and 48 pixel sizes Pass — an ICO file can store several sizes, and the browser picks the one it needs.
PNG 32 by 32, sizes=“32×32” Linked with its size and type Pass — the browser has a sized file to choose for a high-density tab.
SVG favicon, sizes=“any” Linked with type image/svg+xml Pass — a vector icon that scales to any size.
Dark tab background Only the dark-green leaf mark is supplied Fail — the dark mark cannot be read on a dark tab background, and no light version is linked.
Mark at 16 by 16 pixels The full “Maple Corner” wordmark, shrunk Fail — the words are unreadable at 16 by 16; the mark needs simplifying to the leaf alone.

Read the table row by row. Three checks pass and two fail. The files are right: the ICO holds three sizes, the PNG is sized, and the SVG scales. The failures are in what the reader sees: a dark mark on a dark background, and a wordmark that turns to blur at the smallest size.

How to fix a failing row

Simplify the mark for the smallest size

Redraw the 16 by 16 icon as the leaf alone, with no words. A mark that reads at 16 by 16 is one shape, not a sentence.

Link a light version for dark backgrounds

Add a second icon link with media=“(prefers-color-scheme: dark)” pointing to a light leaf mark, so a dark tab loads the light version and the mark stays readable.

Keep the set that already passes

Keep the ICO with 16, 32, and 48 pixel sizes, the sized PNG, and the SVG with sizes=“any”. The browser already has a file for every size it needs.

Limits

The check covers only the favicon files and links on this practice site, read at 16 by 16 pixels and on light and dark backgrounds. It does not cover the home-screen icon or the web app manifest, which use separate links, and it does not cover how a search engine displays the icon. The five checks apply only to this practice site. Expected result. We checked MDN’s page for the link element. We did not publish the Maple Corner site.

Sources

  • MDN, <link>: The External Resource Link element — https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link — shows the favicon link rel=“icon”, states that sizes and type help the browser choose the most appropriate icon, that sizes=“any” means the icon can be scaled to any size, and that ICO can store multiple icon sizes in one file.
See all