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.
Installation steps
- 1
Place all generated favicon files in your public/ or static/ directory.
- 2
Serve static files with express.static('public') before route handlers.
- 3
Add the HTML link tags to your layout template (EJS, Pug, Handlebars, etc.).
- 4
Ensure favicon.ico is at the root — browsers request it automatically.
- 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.icofavicon.svgfavicon-96x96.pngapple-touch-icon.pngandroid-chrome-192x192.pngandroid-chrome-512x512.pngsite.webmanifest