F
Favicon Generator

Favicon generator for Node.js

Serve favicon files from Express, Fastify, or any Node static file setup.

Node.js / Express

Generate your favicon package first, then follow the steps below to integrate with Node.js.

Generate favicons

Installation steps

  1. 1

    Place all generated favicon files in your public/ or static/ directory.

  2. 2

    Serve static files with express.static('public') before route handlers.

  3. 3

    Add the HTML link tags to your layout template (EJS, Pug, Handlebars, etc.).

  4. 4

    Ensure favicon.ico is at the root — browsers request it automatically.

  5. 5

    Test with curl -I http://localhost:3000/favicon.ico.

Code & configuration

Copy and adapt for your Node.js project

// server.js (Express)
const express = require("express");
const path = require("path");
const app = express();

app.use(express.static(path.join(__dirname, "public")));

// Optional explicit route for older crawlers
app.get("/favicon.ico", (req, res) => {
  res.sendFile(path.join(__dirname, "public", "favicon.ico"));
});

// In your layout <head>:
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />

Pro tips

  • For Fastify, use @fastify/static with the same public folder.
  • Set Cache-Control headers for favicon assets in production.

Files to deploy

favicon.ico
favicon.svg
favicon-96x96.png
apple-touch-icon.png
android-chrome-192x192.png
android-chrome-512x512.png
site.webmanifest