The set
| File | Format | Size | Bytes on the test marks |
|---|---|---|---|
icon.svg | SVG | the source’s viewBox | 128–1,527 B, median 339 |
favicon.ico | ICO, one PNG entry | 48×48 | 155–1,036 B, median 309 |
apple-touch-icon.png | PNG, opaque | 180×180 | 151–2,390 B, median 504 |
icon-192.png | PNG, opaque | 192×192 | 161–2,610 B, median 699 |
icon-512.png | PNG, opaque | 512×512 | 290–9,407 B, median 1,082 |
site.webmanifest | JSON | icons only | 220 B |
Bytes are from the 11 marks CI builds at the default effort, on a black ground and with a manifest. The smallest PNGs come from a mark of flat tiles and the largest from a gradient; yours depend on your mark. The manifest is the icons-only one shown below.
The markup
Put these tags in your <head>. favseed --html --manifest prints them, with the config's base in front of every href when the site is served under a path. The Vite plugin and the Astro integration add them for you, to any page that does not already link an icon.
<link rel="icon" href="/favicon.ico" sizes="48x48"> <link rel="icon" href="/icon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="manifest" href="/site.webmanifest">
icon.svg
The favicon for browsers that take an SVG icon, and the file to use for the logo on your pages. It keeps animation, styling and accessibility, and any prefers-color-scheme block, so a dark-mode rule changes the favicon with the browser’s colour scheme. Use the same /icon.svg URL in the link and in <img>, so one cached response serves both.
It is not in the manifest, which lists only the padded PNGs. An SVG entry used to make Chrome’s Android install fail and fall back to a home-screen bookmark (crbug.com/40925759). Chrome 158 installs one, but older releases still fail, and beside the PNGs the SVG changes nothing: Chrome draws the installed icon from the PNG either way.
favicon.ico
The fallback for browsers that do not take the SVG, and the file a browser asks for at /favicon.ico when a page declares no icon. It holds one 48×48 entry: a PNG inside a 22-byte container, transparent and unpadded. The link says sizes="48x48", the size of the bitmap that is actually inside.
Why 48 and not 32: across 20 test marks the larger entry costs about 97 bytes a mark, and the worst error against the source falls from 1.660% to 1.215%. A PNG payload rather than a BMP one, because the BMP that icotool writes by default is 8.8 times larger. Like every raster, it shows the light rules of the SVG; no platform asks a bitmap favicon for a colour scheme.
apple-touch-icon.png
iOS and iPadOS use it for the Home Screen, and Safari for Add to Dock. It is 180×180, 60 pt at @3x, the largest size Apple documents for a web clip; no iPhone renders above @3x. iOS prefers this file to the manifest icons and ignores their purpose.
The mark sits in the safe zone on the --bg ground, so the rounded mask, its corners about 22% of the tile, cuts nothing from it. It is opaque because iOS would composite a transparent icon onto black anyway. Choose the ground to suit the mark: --bg '#fff' for one drawn on light.
icon-192.png and icon-512.png
The manifest’s icons, declared any maskable. Android masks them to a circle, squircle or rounded square, ChromeOS applies its own mask, Chrome installs on macOS take Apple’s rounded shape, and Windows and Linux desktops draw them as they are. web.dev’s install criteria, Chrome’s documentation and MDN all ask for a 192 and a 512 px icon, so those are the default sizes; --sizes takes other even sizes.
One file carries both purposes. Chrome does not offer to install an app whose icons are all maskable, and the mark is padded into the safe zone, so any is true as well. The cost is on desktops that do not mask: there the icon shows a smaller mark on its ground, not edge to edge. --bg none opts out: the numbered icons are then transparent and unpadded, declared any only, and apple-touch-icon.png is still placed in the safe zone.
site.webmanifest
Written with --manifest; the page on this site includes one by default. It lists the padded PNGs and nothing else, one entry per line:
{
"icons": [
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any maskable" },
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" }
]
}Merge your own name, short_name and theme_color, or give them in the config’s manifest object, which writes them ahead of the icons. With vite-plugin-pwa, which writes the manifest itself, pass favseedIcons() to it for the icon entries.
Who reads what
| Platform | Reads | Shape | File |
|---|---|---|---|
| Browser tabs | <link rel="icon"> | none | icon.svg, favicon.ico |
| iOS, iPadOS, Safari Add to Dock | apple-touch-icon | rounded square, corners about 22% | apple-touch-icon.png |
| Android (Chrome, WebAPK) | manifest, any maskable | circle, squircle, rounded square | icon-192.png, icon-512.png |
| ChromeOS (Chrome installs) | manifest, any maskable | Chrome’s own mask | icon-192.png, icon-512.png |
| macOS (Chrome installs) | manifest, any maskable | Apple’s rounded shape | icon-192.png, icon-512.png |
| Windows, Linux desktops | manifest, any maskable | none: drawn as is, on light and dark | icon-192.png, icon-512.png |
Make the set in your browser with the generator or from the command line with favseed; How it works explains the safe zone and how each file is encoded.