Skip to main content
Faviqo

Favicon for Angular

How to add a favicon to an Angular app

Angular ships with a default favicon.ico that is easy to forget about. Generate a full kit below, put it in the right folder for your Angular version and swap the tags in src/index.html.

Generate my Angular icon kit →Free · no upload · one ZIP

Add the favicon in Angular

Upload files to
public/ (Angular 17+) or src/
Add code to
src/index.html
  1. Unzip the package into public/. On older projects use src/ and add each file to the assets array in angular.json.
  2. Open src/index.html and delete the default <link rel="icon" href="favicon.ico">.
  3. Paste the snippet inside <head>.

src/index.html

<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="icon" type="image/png" sizes="48x48" href="/favicon-48x48.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
<link rel="manifest" href="/site.webmanifest">
<meta name="theme-color" content="#FFFFFF">

The file names match what the generator produces. Your theme colour and name are filled in when you generate your own kit.

Angular's build copies only what you list

Angular's build does not simply publish a folder. It copies the entries in the assets array of angular.json, so a favicon that is not matched by an entry never reaches the output and the site returns 404 for it. Newer projects list a public folder there and older ones list src/assets plus src/favicon.ico. Open angular.json and check which pattern your project uses before you add files.

The generated Angular project ships with a default favicon.ico and a matching link in src/index.html. Replace the file and update that tag, and add the rest of the icon tags beside it. Because index.html is a static file, server-side rendering and prerendering do not change where these tags go.

If you serve the app from a sub-path, set the base href in index.html. The icon links are then relative to it, so write them without a leading slash or confirm the leading slash is what you want.

angular.json (build options)

"assets": [
  { "glob": "**/*", "input": "public" }
]

/* older layout */
"assets": [
  "src/favicon.ico",
  "src/assets"
]

Put the kit in the folder this list points at. Then reference the files from src/index.html with plain <link> tags.

Check it worked

  1. Run ng build and look in the output folder. Every icon file you added should be there.
  2. Serve the build and open each icon URL. A page of HTML instead of an image means the file was not copied.
  3. Restart ng serve after changing angular.json, since asset changes are not picked up live.

Why your Angular favicon may not show

  • Angular 17+ serves static files from public/. Older projects use src/ and every file must be listed in the assets array of angular.json, or it is not copied to the build.
  • Delete the default favicon.ico link in src/index.html, or two icons compete.
  • ng serve caches icons in the browser. Hard-refresh or use a private window.
  • Server-side rendering does not change this: the tags still belong in index.html.

Already published? Run your site through the favicon checker to see exactly what is wrong, or see every favicon size for what each file is for.

Angular favicon FAQ

How do I change the favicon in Angular?

Replace favicon.ico and add the rest of the kit in public/ (or src/ on older projects), then update the link tags in src/index.html.

Why is my Angular favicon not showing after build?

On projects that still use src/, the file must be listed in the assets array in angular.json, otherwise it is not copied to dist.

Can Angular use an SVG favicon?

Yes. Add favicon.svg alongside the ICO and a <link rel="icon" type="image/svg+xml"> tag.

Skip the resizing.

Drop in one logo and get every size, the manifest and the HTML for Angular.

Open the favicon generator →