Favicon ToolsVerificarCrear
Framework

Next.js Favicon Generator

Next.js resolves icons from files rather than from link tags you write by hand. Put the right filename in the right directory and the framework emits the markup for you.

How Next.js resolves icons

In the App Router, any file named icon, apple-icon, or favicon in the app directory becomes an icon route. Next.js reads the file, works out the dimensions, and injects the matching link tag into the document head at build time. You do not write the link tags yourself.

The Pages Router has no such convention. There you place files in public and declare them in a custom Head, which is the same manual work as any other framework.

Where the files go (App Router)

  • app/
    • favicon.icoaddbrowser tabs, legacy
    • icon.pngadd512x512 source
    • apple-icon.pngadd180x180, iOS
    • layout.tsx
  • public/
    • manifest.jsonaddPWA install metadata
    • android-icon-192x192.pngadd
    • android-icon-512x512.pngadd

Files marked add are the ones our generator exports. Everything else is a stock Next.js project.

What each file does

FilePurposeConsumed by
app/favicon.icoMulti-resolution tab iconAll browsers, RSS readers
app/icon.pngPrimary PNG icon, scaled by Next.jsModern browsers
app/apple-icon.pngHome screen icon, 180x180iOS Safari
public/manifest.jsonInstall metadata and icon listAndroid, PWA installs

Design for the smallest size first

Example favicon at 16 by 16 pixels
16px
Example favicon at 32 by 32 pixels
32px
Example favicon at 48 by 48 pixels
48px
Example favicon at 96 by 96 pixels
96px
Example favicon at 180 by 180 pixels
180px
Rendered at true pixel dimensions. A mark that survives the 16px swatch survives everywhere; one that only reads at 180px will be mush in a tab.

Linking the manifest

// app/layout.tsx
export const metadata = {
  manifest: "/manifest.json",
};

Icons themselves need no metadata entry: the file convention covers them. The manifest is the one thing you still declare.

Next.js favicon FAQ

Why is my Next.js favicon not updating?

Browsers cache favicons aggressively and separately from the page. Hard-refresh, then confirm the file itself changed by opening /favicon.ico directly. If the old icon still loads there, the build didn't pick up your file.

Do I need favicon.ico if I have icon.png?

Keep both. icon.png covers modern browsers at higher quality, while favicon.ico is what older browsers, feed readers, and some link-preview crawlers still request by path.

Where does apple-icon.png go?

Directly in the app directory, as a 180x180 PNG. Next.js generates the apple-touch-icon link tag from it. iOS ignores transparency, so give it a solid background.

Next.js favicon not working?

The two ways it fails on Next.js, and the exact cause of each.

Related platforms