Favicon Sizes and the Code to Add Them
Five files cover nearly every browser and device: a 32 by 32 favicon.ico, an SVG icon for modern browsers, a 180 by 180 PNG apple-touch-icon for iPhone home screens, and 192 by 192 plus 512 by 512 PNGs listed in a web app manifest. Google Search wants a square icon, ideally larger than 48 pixels.
| File | Size | Used by |
|---|---|---|
| favicon.ico | 32 x 32 | Browser tabs, older browsers, tools that request /favicon.ico |
| icon.svg | Any (vector) | Modern browser tabs, sharp at every size |
| apple-touch-icon.png | 180 x 180 | iPhone and iPad home screen |
| icon-192.png | 192 x 192 | Web app manifest, Android home screen |
| icon-512.png | 512 x 512 | Web app manifest, install and splash screens |
Updated
Older favicon guides list twenty or more sizes for devices nobody uses. Today the browser scales from a few good source files, so the job is picking the right five, writing the head tags correctly and making sure Google can crawl them. Use the builder below to generate the tags and manifest for your own site.
Favicon code builder
Type your site name and theme colour, choose which files you have, and copy the head tags and manifest that match.
Link tags and what each one does
| Tag | Purpose |
|---|---|
| <link rel="icon" href="/favicon.ico" sizes="32x32"> | Classic tab icon, the fallback |
| <link rel="icon" href="/icon.svg" type="image/svg+xml"> | Vector tab icon for browsers that support SVG |
| <link rel="apple-touch-icon" href="/apple-touch-icon.png"> | Home screen icon on iOS and iPadOS |
| <link rel="manifest" href="/manifest.webmanifest"> | Points to the JSON file listing install icons |
| <meta name="theme-color" content="#4F98FB"> | Colours the browser interface on supporting mobile browsers |
Copyable favicon code
Head tags for the five file set
Paste these into the head of every page. The sizes attribute on the ICO stops some browsers from picking it over the SVG.
<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="/manifest.webmanifest">Manifest with standard and maskable icons
Two standard icons plus a padded maskable copy. The type field lets browsers skip formats they cannot use.
{
"name": "Harbor Bakery",
"short_name": "Harbor",
"icons": [
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" },
{ "src": "/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
],
"theme_color": "#4F98FB",
"background_color": "#ffffff",
"display": "standalone"
}SVG favicon that adapts to dark mode
A style block inside the SVG swaps the fill when the browser is in dark mode, so the mark never disappears on a dark tab.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<style>
rect { fill: #1d4ed8 }
@media (prefers-color-scheme: dark) { rect { fill: #93c5fd } }
</style>
<rect x="4" y="4" width="24" height="24" rx="6"/>
</svg>
Why the list got shorter
Browsers now pick the closest icon and scale it, and the SVG format lets one file serve every tab size. The many old Windows tile and Apple sizes were for platforms that have since moved on.
Apple's Safari documentation still describes per-device touch icons, but iOS falls back to a larger icon when no exact match exists, so a single 180 pixel PNG covers current iPhones and iPads well.
The manifest icons
Chromium browsers need at least a 192 pixel and a 512 pixel icon in the manifest before a site can be installed, according to web.dev. With those two, Chrome scales for other densities automatically.
Each manifest icon can carry a purpose of any, maskable or monochrome. Use a separate file for maskable, since padding that suits a cropped shape looks too small when shown square.
Getting the favicon into search results
Google Search shows a favicon next to results when it can find one on your home page. The supported rel values are icon, shortcut icon, apple-touch-icon and apple-touch-icon-precomposed.
Google also accepts several formats, including ICO, PNG, GIF and JPEG. The icon file may even live on another domain, as long as Googlebot is allowed to fetch it.
How it works
- Design one square master at 512 by 512 with the mark centred and some padding.
- Export the five files in the table, or make them with our favicon generator.
- Fill in the builder with your site name and colour, then copy the head tags and manifest.
- Upload the files to the site root, paste the tags into every page's head and hard refresh to check.
Tips
- Test the 16 pixel version on its own; fine text and thin lines vanish at tab size, so simplify the mark.
- Give the SVG a media query for dark mode so a dark logo stays visible on dark browser tabs.
- Keep the important part of a maskable icon inside the centre circle, 40% of the width in radius, because Android may crop the rest.
- Do not block the icon files or your home page in robots.txt; Google needs to crawl both to show your favicon in results.
- Browsers cache favicons aggressively, so rename the file or add a version query when you replace it.
Frequently asked questions
What is the best favicon size?
There is no single best size. Ship a 32 by 32 ICO for compatibility and an SVG for crisp modern tabs, then add the 180 pixel Apple icon and the 192 and 512 manifest icons for home screens. Google Search asks for a square image, at least 8 pixels and preferably larger than 48 by 48.
How do I add a favicon to a website?
Put the files in your site root and add link tags in the head of every page: rel icon for the ICO and SVG, rel apple-touch-icon for the 180 pixel PNG, and rel manifest pointing at a JSON file that lists the 192 and 512 icons. The builder on this page writes those lines for you.
Why is my favicon not showing in Google?
Google needs to crawl both your home page and the icon file, the icon must be square, and the link has to be in the home page head. Updates can take a while to appear because Google recrawls favicons on its own schedule.
Do I still need favicon.ico?
It is worth keeping. Some tools, feed readers and older browsers ask for /favicon.ico directly without reading your HTML, and a small ICO at the root answers them.
What is a maskable icon?
A manifest icon marked with purpose maskable, drawn with extra padding so Android can crop it into a circle, squircle or other shape. Keep the logo inside the central safe zone and fill the background edge to edge.
Related: Favicon generator, Progressive web app guide, Website image sizes, Open Graph image generator.
Build your site free or see all free tools. On We.Inc you can build your site free, with no card and no trial needed to start. AI building is on paid plans from $19 a month.
More in Guides
- Figma to Code: Three Ways, and a Free CSS to Tailwind Converter
- Filesystem MCP Server: Give an Assistant Safe Access to Your Folders
- Firebase Pricing
- Firebase Security Rules Examples
- Food Website Examples: Restaurants, Cafes, Caterers and Food Trucks | How-to Guide
- Framer Motion Examples: 25 Live React Animations
- Franchise Location Pages: How to Make Each One Worth Ranking | How-to Guide
- Can You Get a Free Domain Name? An Honest Breakdown | How-to Guide
Related guides
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App