What is inside an ICO file
An ICO file is a small directory followed by several pictures of the same icon at different sizes. The program that shows the icon picks the picture that fits the place it is drawn. Microsoft's documentation says Windows looks for an exact size match first, and if there is none it takes the next size up and scales it down.
That is why one PNG becomes several pictures. Each picture is a square, from 1 to 256 pixels. The size is stored in one byte, so 256 is written as 0, which is the reason you will see "0" in a technical dump of an ICO directory. Since Windows Vista the pictures can be PNG compressed, and Microsoft recommends that 256 pixel pictures always are.
MDN notes that ICO is mostly a Windows format that browsers still read. Browsers take the picture that suits a tab, so 16 and 32 pixels matter most there.
Which sizes to put in
- A website favicon: 16, 32 and 48. Tabs use 16 pixels, and 32 pixels when the screen is sharper. The 48 pixel picture is there because Google Search wants a favicon larger than 48 pixels and 48 is the usual step to include.
- A Windows app or shortcut: 16, 24, 32, 48 and 256. Microsoft's guide to Win32 icons calls these the bare minimum, and says that with a 256 pixel picture Windows only ever has to scale down. Windows asks for more sizes on high-density screens, for example 24 pixels in the taskbar at 100 percent scale and 48 pixels at 200 percent.
- Everything up to 256. Tick 64 and 128 as well if you want the best match on large icon views. Each picture is stored separately, so the file grows with every size you add.
The 256 pixel picture is the heaviest. In our test a 200 pixel PNG became a 41 KB ICO with five sizes, and most of that was the 256 pixel entry.
Transparency, and the PNG you start from
A PNG can have an alpha channel, and the ICO keeps it. The tool draws every size from your picture with a Lanczos filter on straight RGBA pixels, so a see-through logo stays see-through and its soft edges stay soft. Check how it looks on a dark taskbar as well as a light one.
If the PNG is not square, Fit shows all of it and leaves empty space on two sides, while Fill cuts a square from the middle. Space around the picture adds a margin, Background fills the square with a colour, and Rounded corners can make a circle.
A picture smaller than a size you asked for is enlarged, and the page says so. A 200 pixel PNG gives a soft 256 pixel entry, so either leave 256 out or start from a bigger picture, ideally an SVG.
Where this ICO will not work
Wikipedia notes that PNG pictures inside an ICO cannot be read before Windows Vista. MDN still suggests the older bitmap form inside ICO files for that reason. This tool writes only the PNG form, because every current browser and every supported version of Windows reads it.
An ICO file is also not a good web image on its own. MDN says ICO files should not be used in web content other than as a favicon. For logos on a page, use PNG, WebP or SVG.