Favicon for Nuxt
How to add a favicon in Nuxt
To add a favicon in Nuxt 3, place your icon files in the public folder (served at the site root) and declare the <link> tags through app.head in nuxt.config.ts, or with useHead in app.vue. Nuxt injects the tags into every page's head for you, and public/ files resolve at /.
What you need
- favicon.ico plus PNG favicons (32x32), a 180x180 apple-touch-icon, and 192/512 PWA icons.
- The public folder, which Nuxt serves from the site root.
- An app.head config in nuxt.config.ts (or useHead in app.vue) to declare the icon link tags.
Step-by-step: add a favicon in Nuxt
- Generate your icon set. Use Logo2Favicon to create favicon.ico, the PNG sizes, the Apple touch icon, the PWA icons, a maskable icon, and the manifest - in-browser, nothing uploaded.
- Add the files to public/. Copy favicon.ico, favicon-32x32.png, apple-touch-icon.png, and site.webmanifest into the public folder. Nuxt serves these from /.
- Declare the link tags. In nuxt.config.ts, add the icons under app.head.link, or call useHead in app.vue with the same link array. Nuxt injects them into the head site-wide.
- Build and verify. Run nuxt build (or nuxt dev) and confirm the tab icon and that /favicon.ico and /site.webmanifest return 200.
export default defineNuxtConfig({
app: {
head: {
link: [
{ rel: 'icon', href: '/favicon.ico', sizes: 'any' },
{ rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' },
{ rel: 'manifest', href: '/site.webmanifest' },
],
},
},
});Common mistakes to avoid
- Putting icons in assets/ instead of public/ - assets/ is bundled and hashed, so /favicon.ico 404s.
- Declaring the link tags in one page's useHead instead of nuxt.config or app.vue, so only that page gets them.
- Duplicating tags by setting them both in nuxt.config and a page-level useHead.
- Forgetting the manifest, so Android home-screen and PWA installs fall back to a generic glyph.
Free forever, no sign-up
Generate a complete icon set for Nuxt
One logo in, every file out: favicon.ico, the PNG sizes, the Apple touch icon, Android and PWA icons, a maskable icon, the web manifest, and a copy-paste snippet ready for Nuxt. Free, private, and generated in your browser.
Open the generatorFrequently asked questions
- Where do I put the favicon in a Nuxt 3 project?
- In the public folder, which Nuxt serves from the site root, so public/favicon.ico becomes /favicon.ico. Declare the link tags via app.head in nuxt.config.ts or with useHead in app.vue.
- How do I set favicon link tags in Nuxt?
- Add them to app.head.link in nuxt.config.ts for a site-wide default, or call useHead with a link array in app.vue. Nuxt merges and injects the tags into the document head for every route.
- Why does my Nuxt favicon 404?
- The file is probably in assets/ (which Nuxt bundles and hashes) rather than public/. Move it to public/ so it is served verbatim at the root, and confirm the link href matches the filename.
- Should favicon files go in public/ or assets/ in Nuxt?
- Use public/. Files in assets/ are processed by the bundler and get hashed URLs, breaking the predictable /favicon.ico path. public/ is copied to the root unchanged, which is what a root favicon needs.
Favicon guides for other platforms
New to favicons? Read the complete favicon guide and the icon size cheatsheet, or jump straight to the favicon generator.