How to Make a Favicon: Convert PNG to ICO and Install It
Learn how to make a favicon from a PNG or logo: convert PNG to ICO, design an icon that reads at 16 pixels, add the HTML tags and fix a favicon not updating.
Updated
To make a favicon, start with a square logo of at least 512 x 512 pixels, run it through a favicon generator to produce a favicon.ico plus PNG icons for phones, upload the files to the root of your site, and add a few link tags to the page head. The whole job takes a few minutes. The steps below cover the design, the PNG to ICO conversion, the installation and the checks.
Step 1: prepare a square source image
A favicon is square, so your source must be too. Use the highest quality version of the logo you have:
- An SVG is ideal because it scales cleanly to every size.
- A PNG with a transparent background works well if it is at least
512 x 512pixels. - A JPG is acceptable but has no transparency, so you will get a solid background.
If the logo is a wide wordmark, do not shrink the whole thing into a square. At 16 pixels it becomes a gray smear. Use only the symbol, or the first letter. To cut a square region out of a larger image, open the Image Cropper, choose the 1:1 preset, frame the mark and download.
Step 2: design for 16 pixels
The tab icon is 16 x 16 pixels on a standard screen. That is 256 pixels in total. Designs that survive at that size follow a few rules:
- One shape. A single letter, a simple symbol or a bold monogram. Remove taglines, thin outlines and small details.
- Strong contrast. The icon has to stand out against both a light tab strip and a dark one. A mid-tone logo on a transparent background can vanish in one of them.
- Fill the square. Thin margins make the icon look smaller than its neighbors. A little padding is good for home screen icons, but the tab icon should use most of its space.
- Flat colors. Gradients and shadows turn muddy when they are scaled down.
- Thick strokes. A line needs to be at least 2 pixels wide at 16 pixels to stay visible, which means roughly an eighth of the icon's width.
A solid background color solves the contrast problem at once. A white letter on a brand-colored square reads clearly on any browser theme.
Step 3: convert the PNG to ICO and the other sizes
Renaming logo.png to favicon.ico does not make an ICO file. The ICO format is a container with its own header that holds one or more images, and it has to be built. Some browsers tolerate a renamed PNG, but it is not reliable.
- Open the Favicon Generator.
- Drop in your PNG, JPG, WebP or SVG. Any size is accepted, though a square source of 512 pixels or more gives the best result.
- Look at the previews. The tool draws the icon at 16, 32, 48, 180 and 192 pixels. Switch the preview between light and dark to test contrast.
- Adjust the background, corner style and padding until the small previews read clearly.
- Download the package as a ZIP.
The settings in step 4 are:
- Background: transparent, or a solid color you pick. Choose a color if the icon will be used on an iPhone home screen, where transparent areas are shown as black.
- Corner style: square, rounded or circle.
- Padding: from 0 to 25 percent, to keep the logo off the edges.
If your image is not square, the generator fits it inside the square and leaves the remaining space as background, so cropping first gives a larger, clearer icon.
The ZIP contains:
| File | Contents |
|---|---|
| favicon.ico | 16, 32 and 48 pixel images in one file |
| favicon-32x32.png | 32 pixel PNG |
| apple-touch-icon.png | 180 pixel PNG for iOS home screens |
| android-chrome-192x192.png | 192 pixel PNG for Android |
| android-chrome-512x512.png | 512 pixel PNG for Android splash screens |
| site.webmanifest | Web app manifest listing the two Android icons |
| README.txt | The HTML snippet and file list |
For what each size is for and how ICO, PNG and SVG compare, see the favicon size guide.
Step 4: install the files
Upload every file from the ZIP to the root folder of your site, the same folder that serves your home page. The icon should then load at https://yoursite.com/favicon.ico.
Next, copy the HTML snippet from the generator and paste it inside the head element of your pages, or in the shared layout or template if your site has one:
<link rel="icon" type="image/x-icon" href="/favicon.ico"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" type="image/png" sizes="512x512" href="/android-chrome-512x512.png"><meta name="theme-color" content="#ffffff">
Two things to finish by hand:
- Open
site.webmanifestin a text editor and fill in the emptynameandshort_namefields with your site name. These are shown under the icon when someone installs the site on Android. - The snippet does not link the manifest. If you want Android and installed web apps to use it, add
<link rel="manifest" href="/site.webmanifest">to theheadas well.
If the files live in a subfolder, change each href and each src in the manifest to match. If you use a site builder or CMS, you may not need the tags at all. WordPress, for example, has a Site Icon setting under Appearance, Customize, Site Identity, which takes one square image of at least 512 pixels and generates the sizes itself.
Step 5: test it
- Open
yoursite.com/favicon.icodirectly. You should see the icon, not an error page. - Load a page and check the tab.
- View the page source and confirm the link tags are present and the paths are correct.
- On a phone, use Add to Home Screen and check the icon there.
When the favicon does not update
Browsers cache favicons more stubbornly than almost anything else, so an old icon can linger for days after you replace the file. Try these in order:
- Open the favicon URL directly and reload that page.
- Hard refresh the site: Ctrl+Shift+R on Windows and Linux, Cmd+Shift+R on a Mac.
- Open the site in a private window.
- Add a version to the file reference, such as
href="/favicon.ico?v=2". The browser treats it as a new file.
If the icon is missing rather than stale, the cause is usually a wrong path, a file uploaded to the wrong folder, or a link tag placed outside the head.
Try it
Drop your logo into the Favicon Generator, check the 16 pixel preview, and download the ZIP with favicon.ico, the PNG icons, the manifest and the HTML snippet ready to paste.