Favicon.im

Development API · Website favicons · Multiple sizes · No auth

TL;DR

Favicon.im is a dead-simple API that returns any website's favicon by just passing the domain name. Supports multiple sizes (16x16, 32x32, 64x64, 128x128, 256x256) and defaults to a sensible fallback when no favicon is found. It's the easiest way to add favicon previews to bookmark managers, link-sharing apps, and browser extensions.

Quick start: https://favicon.im/github.com

No API key needed — just make a request!

How to Use This API

1. Get Favicon (Default Size)

https://favicon.im/github.com

Returns the favicon for the domain as an image. Default size is 64x64.

2. Specific Size

https://favicon.im/github.com?size=128

Available sizes: 16, 32, 64, 128, 256. Larger sizes look better in UI components.

3. HTML — Bookmark List

<ul class="bookmarks">
  <li>
    <img src="https://favicon.im/github.com?size=32"
         alt="" width="32" height="32">
    <a href="https://github.com">GitHub</a>
  </li>
  <li>
    <img src="https://favicon.im/stackoverflow.com?size=32"
         alt="" width="32" height="32">
    <a href="https://stackoverflow.com">Stack Overflow</a>
  </li>
  <li>
    <img src="https://favicon.im/reddit.com?size=32"
         alt="" width="32" height="32">
    <a href="https://reddit.com">Reddit</a>
  </li>
</ul>

4. JavaScript — Favicon for User-Submitted Links

function linkPreview(url) {
  const domain = new URL(url).hostname;
  
  const container = document.getElementById('link-preview');
  if (container) {
    container.innerHTML = `
      <img src="https://favicon.im/${domain}?size=32"
           alt="" width="32" height="32"
           style="vertical-align:middle;margin-right:8px">
      <a href="${url}" target="_blank">${domain}</a>
    `;
  }
}

linkPreview('https://news.ycombinator.com');
5. Python — Batch Favicon Download
import requests

def download_favicons(domains, size=64):
    for domain in domains:
        resp = requests.get(
            f'https://favicon.im/{domain}',
            params={'size': size}
        )
        if resp.status_code == 200:
            filename = f'{domain.replace(".", "-")}.png'
            with open(filename, 'wb') as f:
                f.write(resp.content)
            print(f'Saved favicon for {domain}')

download_favicons(['google.com', 'youtube.com', 'facebook.com', 'wikipedia.org'])
Try GitHub favicon: https://favicon.im/github.com?size=128

Frequently Asked Questions

What if a website has no favicon?
Favicon.im returns a clean placeholder/default icon instead of a broken image. Your UI never shows a broken image icon.
What size should I use?
16 or 32 for inline/favicon use (matching standard favicon sizes). 64 for most UI icons. 128+ for high-resolution displays or larger previews.
What format is returned?
PNG format — the API converts source favicons (which may be ICO, PNG, or SVG) to PNG for consistent display.
Does it work with subdomains?
Yes. Pass any domain including subdomains: favicon.im/subdomain.example.com.
Are there rate limits?
Free service with reasonable usage limits for personal and development projects. The API is maintained as a public utility.

API Details

API URL
https://favicon.im
Documentation
favicon.im
Category
Development
Authentication
Not Required
Geographic Coverage
Global

What You Can Build