WEB-8Recommended
Ship a full set of icons
Ship an SVG favicon, a /favicon.ico fallback, a 180 px opaque apple-touch-icon, and 192, 512 and maskable icons for installed web apps.
How to do it
Start from one square image. Export favicon.svg, a favicon.ico with 16, 32 and 48 px sizes, and a 180 px opaque apple-touch-icon.png. Add 192 and 512 px PNGs, plus a maskable 512 px PNG with a safe zone.
Examples
HTML example
<link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/manifest.webmanifest">
JSON example
{
"icons": [
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" },
{ "src": "/icon-maskable.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
]
}
How to check
curl -sI on each icon answers 200 with image/svg+xml, image/x-icon (or image/vnd.microsoft.icon) or image/png. The maskable icon keeps its logo inside the central 80% circle. The full manifest is in let people install the site.
Sources
Related rules
- WEB-225 Let people install the site in Website
- SEO-46 Give search results a favicon they can show in SEO
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/html-basics/favicons">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.