ICO

ICO Format Explained — Windows Icons and Favicons

ICO explained: many image sizes in one file, header structure, Windows sizes (16, 32, 48, 256px), PNG icons, favicons and PNG-to-ICO tips.

Extension.ico
MIMEimage/x-icon (conventional)
SpecificationMicrosoft documentation (no official international standard)
Internal formatBMP (DIB) or PNG
TransparencyYes (32-bit alpha or PNG)
Multiple sizesSeveral resolutions in one file
Recommended Windows sizes16 · 32 · 48 · 256px

ICO is the format Windows uses to store program, file and shortcut icons. The official media type registered with IANA is image/vnd.microsoft.icon, but image/x-icon is more widely used in practice (MDN). What sets it apart most from ordinary image formats is that a single file holds images in several sizes. Windows picks the most suitable size depending on the context, such as the taskbar, File Explorer lists or the large icons view.

Structure

An ICO file starts with a short header and an "image list (directory)". Each entry in the list records the width, height, color count and data location, followed by the actual images. Each image is stored in one of two ways:

  • BMP (DIB) format: The traditional method. It stores color data together with a 1-bit AND mask (transparent or not), and 32-bit images use an alpha channel for smooth transparency. The file header (BM) is omitted.
  • PNG format: Supported since Windows Vista. It can hold large icons at a small file size.

A look at the header

The first 6 bytes of an ICO file are a reserved value (0), the type (1 = icon, 2 = cursor) and the number of images. Then a 16-byte entry follows for each image, recording the width, height, color count, data size and location. Because the width and height fields are 1 byte and can only go up to 255, there's a rule that 256 pixels is written as 0. Cursor files (.cur), which use the same structure, store the click point (hotspot) coordinates in place of the entry's color planes and bit count fields.

Recommended Windows sizes

Microsoft's icon design guidelines recommend including 16×16, 32×32, 48×48 and 256×256 in application icons. The 256×256 icon was added in Vista, and this large size is usually stored with PNG compression. Small sizes look sharper when redrawn separately with thicker lines and less detail rather than simply scaled down from a large image.

Windows picks the closest size in the file based on display scaling (DPI setting) and the File Explorer view, and scales up or down to create sizes that are missing. So including all the commonly used sizes keeps icons crisp on any screen. Many places, like favicons in browser tabs, display at 16×16, so the smallest size matters especially.

Favicons and ICO

Website favicons have long been served as /favicon.ico at the site root, and every major browser supports it. Specifying PNG or SVG favicons with <link rel="icon"> is now recommended (MDN), but some programs request /favicon.ico directly without a link tag, so many sites keep an ICO as well.

Google Search Central says a favicon shown in search results must be square (1:1) and at least 8×8 pixels, and recommends a size larger than 48×48 pixels so it looks good on various screens. It lists ICO, PNG, GIF, JPEG, BMP and others as supported formats.

Things to watch when converting

  • Use a square original. Rectangular images get stretched or padded. If needed, first crop to 1:1.
  • Using a PNG with a transparent background as the original gives natural icon corners. A JPG original leaves a white square background.
  • At very small sizes like 16×16, text isn't readable, so it's better to keep only the core shape of your logo.
  • Converting PNG to ICO lets you put several sizes in one file.
  • Windows File Explorer caches icons, so if you've changed an icon but still see the old one, wait for the cache to refresh or rename the file to check.

Last updated: 2026-09-23

Sources

← Back to formats