Guides · Updated 2026-12-04
Favicon formats: ICO vs PNG vs SVG
Three image formats can serve as a favicon, and the internet is full of conflicting advice about which one to choose. The honest answer is that you should not choose only one. Each format covers a different part of the problem, and the best result comes from a short combination.
This article explains what ICO, PNG and SVG each do, what their limits are, and how to declare them so every browser gets the best file it can use.
ICO: the universal fallback
The ICO format dates from Windows 1.0-era icon files, and it survives in browsers because it can hold several bitmap sizes in a single file. A well-made favicon.ico contains 16, 32 and 48 pixel versions, and the browser picks the one closest to what it needs.
Its main strength is compatibility. Every browser has supported /favicon.ico for decades, and that default request is made even when no link tag exists. Crawlers, RSS readers, bookmark managers and email clients also tend to ask for it. Its weaknesses are that it is a bitmap, so it can look soft when scaled, and that creating a correct multi-size ICO by hand needs a converter.
Keep an ICO at the root of your site. Treat it as the safety net, not the headline file.
PNG: sharp, simple and widely supported
PNG is a normal raster image with lossless compression and full alpha transparency. Every current browser accepts a PNG favicon declared with a link tag, and it looks crisp at the exact size you supply. A 32 by 32 PNG is a common choice for standard screens, and a 48 or 64 pixel version helps on dense displays.
PNG is also the format required for the Apple touch icon and for the 192 and 512 pixel icons in a web app manifest. Those uses are not optional: the manifest does not accept SVG for icons on every platform, and iOS ignores SVG for home screen icons.
The limit of PNG is that it is fixed in size. If you want sharpness at every scale and for both light and dark browser themes, a single PNG cannot do it.
SVG: one file, every size, adaptive colour
SVG is a vector format, which means it is described by shapes, not pixels. One small file stays sharp at any size, so it suits tabs on a standard laptop and on a high-density phone equally. A simple icon is often only one or two kilobytes.
SVG favicons can also react to the browser theme. Because the file can contain CSS, a prefers-color-scheme media query inside it lets the same icon switch between dark and light versions. That solves the common problem of a dark logo vanishing against a dark tab bar.
The caveat is support. Chrome, Edge and Firefox accept SVG favicons, but support has been uneven in Safari and in some other places that read icons, such as certain feed readers and link scrapers. For that reason an SVG should never be your only icon.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<style>
.bg { fill: #111827; }
.fg { fill: #ffffff; }
@media (prefers-color-scheme: dark) {
.bg { fill: #ffffff; }
.fg { fill: #111827; }
}
</style>
<rect class="bg" width="32" height="32" rx="7"/>
<path class="fg" d="M10 9h12v4h-8v3h7v4h-7v4h-4z"/>
</svg>A side-by-side comparison
What each format gives you in practice:
- Compatibility: ICO is the widest, PNG is near-universal, SVG is good in modern desktop browsers but patchy elsewhere.
- Sharpness: SVG is perfect at any size, PNG is perfect at its own size, ICO is perfect only at the sizes it contains.
- File size: SVG is usually smallest for simple marks, ICO is the largest because it stores several bitmaps.
- Dark mode: only SVG can adapt to the browser theme by itself.
- Home screens: iOS and Android need PNG, not SVG or ICO.
The combination that works
The reliable setup is an ICO for the default request, an SVG for modern browsers, a 180 pixel PNG for Apple, and the manifest PNGs for Android. Declared together, browsers choose the best option they understand and ignore the rest.
<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/site.webmanifest">How browsers choose between them
When a page lists several icons, the browser looks at the type and sizes attributes and picks the best match for its needs. A browser that understands SVG will usually take the vector. One that does not will skip it and use the ICO. This is why the type attribute on the SVG link matters: it lets a browser reject a format it cannot read without downloading it.
The sizes attribute on the ICO link is a hint, not a rule. Declaring sizes 32x32 helps Chrome prefer the SVG when both are present, because it stops the ICO from being treated as a candidate of any size.
What about WebP, AVIF and GIF?
You may see tutorials using WebP or an animated GIF as a favicon. Some browsers accept them, but support is inconsistent and gains are tiny at these sizes. Animated favicons are distracting and are ignored or frozen by several browsers. Stay with ICO, PNG and SVG; they are boring on purpose.
Was this guide helpful?
Questions
Should I use SVG as my only favicon?
No. SVG is excellent in modern desktop browsers, but Safari support has been inconsistent and many scrapers ignore it. Keep favicon.ico and a PNG fallback.
Is ICO outdated?
The format is old, but it remains the default that browsers and crawlers request from /favicon.ico. It is still worth shipping as a fallback.
Can a favicon change for dark mode?
Yes, with an SVG that contains a prefers-color-scheme media query. PNG and ICO files cannot change by themselves.
Try it
More guides
- How to add a favicon to your website
- The Apple touch icon: size, format and common problems
- Favicon not showing or not updating: nine fixes
- Maskable icons explained: the safe zone and how to use it
- The web app manifest: what each field does
- How to design a favicon that is readable at 16 pixels
- How to get your favicon to show in Google Search results
- Open Graph image not showing: a checklist that finds the cause
- How to test Open Graph tags before you deploy
- Favicon setup in Next.js, Vite and React