What it is
An ICO file is a small directory: a header listing several pictures of the same icon, each at its own size and colour depth, followed by the pictures themselves. Each entry is stored either as a PNG or as a bitmap with a one-bit transparency mask. Windows, browsers and shortcuts read the directory and use the size that suits the place the icon appears.
Cursor files (.cur) use the same layout with a hotspot added. Mac applications use a different format, ICNS, though macOS opens ICO files for viewing.
Where it opens
The rows below are about software a file will actually be handed to, not about a specification. A format is supported when the person you sent it to can open it.
| Where | What happens |
|---|---|
| Browsers, as a favicon | Every major browser reads /favicon.ico, and picks the size it needs from inside it. |
| Browsers, as an image | Chrome, Edge, Firefox and Safari display an ICO in a page, showing one of its sizes. |
| Windows | The native icon format for programs, shortcuts and folders; Explorer previews ICO files. |
| macOS | Preview opens ICO files, but Mac apps use their own icon format (ICNS), not ICO. |
| Very old software | Windows XP-era programs cannot read PNG-compressed entries, which is why small sizes are written as bitmaps. |
What it costs to write
Written here by this site's own ICO writer: every size is resampled from the original, the 256-pixel entry stored as PNG and the small ones as 32-bit bitmaps with a transparency mask (or PNG for all). An icon with four sizes is written in a fraction of a second. Reading works the other way: the directory is parsed and every entry decoded, bitmap entries by this site's own reader.
Where it goes wrong
- An icon with only one large size gets scaled down by whatever shows it, and a 16-pixel tab icon made that way often looks blurred.
- A 256-pixel entry stored as a bitmap is about 256 KB on its own; stored as PNG it is usually a few kilobytes.
- A picture that is not square has to be padded or cropped; stretched icons look wrong at every size.
- Opening an ICO as an ordinary image shows only one of its sizes, which can make an icon look smaller or blurrier than it is.
When this is the right answer
ICO is the right answer for a website’s favicon.ico and for Windows program and shortcut icons. A sensible set is 16 and 32 pixels for browser tabs, 48 for Windows, and 256 for high-density screens and large Windows icons. Modern pages often add a PNG apple-touch icon of 180 pixels alongside.
PNG to ICO on this site packs the sizes you choose into one file, resampled from your original; ICO to PNG lists every picture inside an existing icon and saves any of them.
Questions about ICO
Which sizes should a favicon.ico contain?
Why does one ICO file contain several pictures?
Can an ICO be transparent?
How do I get a PNG out of an ICO?
Is ICO better than PNG for a favicon?
Encoding happens on this machine; the file stays where it is.