https://www.google.com/s2/favicons, that returns a website’s favicon as a PNG. You pass a domain and an optional size, and Google returns the icon it has stored for that site. You don’t need a key or an account.
How to use the Google Favicon API
Put the URL in an<img> tag:
The request answers with a
301 redirect to a gstatic.com host, which serves the image. Browsers follow the redirect automatically. In your own code, turn on redirect following, or you’ll get the redirect back instead of the image.
Which sizes the Google Favicon API returns
Only certainsz values work. These are the ones Google honored in our tests on November 5, 2026:
Even then, the size is a ceiling, not a promise, because Google can only serve the icons a site publishes. Asking for
sz=256 returned 256px for stripe.com, but 192px for nike.com and only 32px for github.com. Check the image’s real size before you render it large.
What happens when there is no favicon
When Google has no icon for a domain, it returns a grey globe at 16px with a404 status, whatever size you asked for.
Browsers render the globe anyway, and the <img> tag fires onload instead of onerror. So your page can’t tell a miss from a real icon. The only way to catch a miss is to fetch the URL from your own code and check for the 404.
Favicon vs logo
A favicon is a browser-tab icon, designed to be legible at 16 by 16 pixels. Many favicons are cropped, simplified, or unrelated to the company’s actual logo. A logo API returns the brand’s real assets instead: the icon, the symbol, and the full horizontal logo, in light and dark versions. There’s also no brand data behind Google’s endpoint. It returns whatever the site declares, with no check that it represents the company. Brandfetch returns a logo for 95% of brands in its core sample, and for 86% in an uncurated sample of local, non-tech businesses. The method and results are published on coverage and quality.Google Favicon API vs Brandfetch Logo API
Switch from the Google Favicon API
Switching is a one-line change. Keep the same domain, and set the size withw and h:
Google Favicon API
iconis the square brand icon and the closest match to a favicon.logogives you the horizontal logo, andsymbolgives you the mark.theme/lightreturns a light logo for dark backgrounds.fallback/404returns an empty404on a miss, so you can show your own placeholder.fallback/lettermarkreturns the brand’s initial on a square.
FAQ
Is the Google Favicon API free?
Is the Google Favicon API free?
Yes, it needs no key or account. But Google doesn’t publish any limits or terms for it, so there’s no guarantee it stays available.
What is the largest size the Google Favicon API returns?
What is the largest size the Google Favicon API returns?
256px, and only when the site publishes an icon that large. Any value above 256 returns a 16px icon.
Why does the Google Favicon API return a globe?
Why does the Google Favicon API return a globe?
The globe means Google has no favicon for that domain. It comes back at 16px with a
404 status, but an <img> tag displays it anyway.Can the Google Favicon API return a company logo?
Can the Google Favicon API return a company logo?
No, it only returns the favicon the site declares. For a company’s logo, symbol, or icon in light and dark versions, use a logo API such as the Brandfetch Logo API.
Get started
Logo API overview
Show any company’s logo with an image URL.
Get your client ID
Free account, no credit card required.