Fetch a website’s favicon easily using Google’s public endpoints:
https://www.google.com/s2/favicons?domain=DOMAIN
- DOMAIN: The domain name (e.g.,
stackoverflow.com) - Returns: The default favicon (PNG, usually 16px)
https://www.google.com/s2/favicons?domain=DOMAIN&sz=SIZE
- sz (optional): Requested PNG size. Accepts values like
16,32,64,128(default: 16px) - Example:
https://www.google.com/s2/favicons?domain=twitter.com&sz=64
You can provide the full site URL, not just the domain:
https://www.google.com/s2/favicons?domain=https://www.notion.so
For specific integrations, Google uses a slightly different endpoint in its services:
https://www.google.com/s2/favicons?sz=SIZE&domain_url=SITE_URL
- domain_url: Full website address
- Example:
https://www.google.com/s2/favicons?sz=32&domain_url=https://github.com
- The favicon returned is always in PNG format.
- If the domain does not have a favicon, Google may return a blank or fallback icon.
- These endpoints are not officially documented by Google, but are widely used in browser extensions, apps, and web tools.
- Reliable for most public sites, but results may vary for uncommon domains.
// 16x16 PNG favicon for Stack Overflow
https://www.google.com/s2/favicons?domain=stackoverflow.com
// 128x128 PNG favicon for Notion
https://www.google.com/s2/favicons?domain=notion.so&sz=128
// 32x32 PNG favicon for GitHub (using domain_url)
https://www.google.com/s2/favicons?sz=32&domain_url=https://github.com
Feel free to copy and use these endpoints in web projects, browser extensions, and scripts!