If the browser tab shows a generic globe while your Gradio app loads normally, the app is missing its icon metadata. A Gradio favicon is easiest to add through the launcher, where Gradio can register the file without you editing its generated page template.

You do not need to place a <link> tag inside a gr.HTML component or duplicate the icon across every component. Configure the icon once at application startup, then confirm that the browser actually requests the file.

Prerequisites

Before you start, you need a Gradio application you can restart, one square icon file, and access to the process that starts the app.

If your artwork starts as PNG or SVG, convert it before deployment. You can use Mzu favicondl to create the ICO, then keep the generated file named favicon.ico. The PNG to ICO guide explains the sizing options.

1. Prepare the favicon file

Create an assets directory beside the Python entry point. Store the icon at a stable path so every copy of the project—local, container, or hosted—uses the same reference.

your-gradio-app/
├── app.py
└── assets/
    └── favicon.ico

Design for the tab, not for a full logo page. A bold shape or one letter usually survives the 16-pixel rendering better than fine text. Keep the source square, and avoid relying on a wide image being cropped unpredictably.

2. Set the Gradio favicon with launch()

Pass the absolute file path to the favicon_path argument on demo.launch(). This is the Gradio-specific switch; do not put it inside gr.Blocks().

from pathlib import Path

import gradio as gr

app_dir = Path(__file__).resolve().parent
favicon = app_dir / 'assets' / 'favicon.ico'

if not favicon.is_file():
    raise FileNotFoundError(f'Favicon not found: {favicon}')

with gr.Blocks() as demo:
    gr.Markdown('# My Gradio app')

demo.launch(favicon_path=str(favicon))

The Path(__file__).resolve().parent expression anchors the icon to the script rather than the shell's current directory. The is_file() check catches a missing or mistyped asset before startup continues. Point this option to a local file; a remote image URL is not a substitute for a deployable asset.

3. Verify the icon locally

Stop the running server and start it again after changing code. Browser tabs cache icons aggressively, so verify the result in a new tab or a private window rather than relying on the old tab.

Inspect the page source under <head> and look for a link whose rel value is icon. The HTML specification defines icon as a link relation for an external resource, which lets the browser fetch that file separately from the app page.

In developer tools, open the Network panel and reload the page. Confirm that the icon request returns 200 rather than 404, and check that the response is the file you uploaded. If the link exists but the tab still shows an old symbol, use the broader favicon troubleshooting checklist to inspect caching and conflicting icon links.

4. Deploy the asset with the app

Deploy the icon with the application, not only on your laptop. Your delivery package needs both app.py and assets/favicon.ico at the relative locations shown above.

The same check matters when a platform supplies its own site-icon setting. If the Gradio app is embedded inside another page, the top-level document may control the browser tab. In that arrangement, update the parent page's icon as well as Gradio's launcher.

Common pitfalls

Most failed Gradio favicon setups come from a few small mistakes:

Conclusion

A Gradio favicon is easiest to manage as a launch-time asset: put a square ICO beside the app, pass its resolved path to launch(favicon_path=...), and verify the rendered icon request. That keeps the implementation small and gives local and hosted Gradio apps one obvious file to update when the mark changes.