ICO (Windows Icon) Format — Complete Guide
What Is ICO?
ICO is a file format for icons used by the Microsoft Windows operating system and Windows applications. An ICO file is a container — not a single image, but a collection of images stored at multiple sizes and colour depths, all in one file. When Windows renders an icon (on the desktop, in the taskbar, in folder views, or in application titlebars), it selects the best-matching image from the ICO container based on the display context and screen DPI.
The format dates to Windows 1.0 (1985) and has evolved across Windows versions. Modern ICO files support PNG-compressed images at up to 256 × 256 pixels and RGBA colour with full 8-bit alpha transparency.
ICO Container Structure
ICONDIR Header
Every ICO file begins with a 6-byte ICONDIR (Icon Directory) header:
Reserved : 2 bytes (always 0)
Type : 2 bytes (1 = icon, 2 = cursor)
Count : 2 bytes (number of images in the container)
Following the header, there is one ICONDIRENTRY (16 bytes) per image:
Width : 1 byte (0 = 256)
Height : 1 byte (0 = 256)
ColorCount : 1 byte (0 for 32-bit)
Reserved : 1 byte (always 0)
Planes : 2 bytes (colour planes; always 1)
BitCount : 2 bytes (bits per pixel)
BytesInRes : 4 bytes (size of image data in bytes)
ImageOffset : 4 bytes (offset from file start to image data)
Each image in the ICO is either a DIB (Device-Independent Bitmap) or, since Windows Vista, a PNG stream.
Standard Sizes and When Windows Uses Each
Windows applications are expected to provide icons at specific sizes. Display contexts dictate which is selected:
| Size | Use case |
|---|---|
| 16 × 16 | Taskbar, window titlebar, small folder view, browser favicon |
| 24 × 24 | Toolbar icons (some applications) |
| 32 × 32 | Standard desktop icon (96 DPI / 100 % scaling) |
| 48 × 48 | Large icons in File Explorer |
| 64 × 64 | Extra-large icons; high-DPI desktops |
| 128 × 128 | High-DPI large icons |
| 256 × 256 | Windows Vista+ "extra-large" view; HiDPI / 200 % scaling |
A well-prepared ICO file for a modern Windows application typically contains 7–9 sizes covering 16, 24, 32, 48, 64, 128, and 256 px, ensuring crisp rendering at all DPI scaling levels.
Colour Depths
32-bit RGBA (Modern Standard)
32-bit ICO images use 8 bits per channel (RGBA): full 24-bit colour plus an 8-bit alpha channel. This allows smooth anti-aliasing, soft shadows, and semi-transparent edges — essential for icons that look professional against any desktop wallpaper.
8-bit Indexed (256 Colours)
Used for backward compatibility with very old Windows versions. The image stores pixel values as indices into a 256-colour palette. Transparency in 8-bit ICO is binary (1-bit XOR mask) — pixels are either fully opaque or fully transparent with no anti-aliasing.
4-bit (16 Colours) and 1-bit (Monochrome)
Legacy formats rarely used today. Windows still renders them in high-contrast accessibility modes. Modern ICO generators do not include them unless explicitly required.
PNG Compression Inside ICO (Windows Vista+)
Since Windows Vista, images within ICO files may be stored as complete, valid PNG streams instead of raw DIB data. PNG-compressed ICO entries:
- Dramatically reduce file size for large images (256 × 256 PNG ≈ 10–30 KB vs. 300 KB as raw 32-bit bitmap)
- Retain full RGBA colour and alpha transparency
- Are fully supported by Windows Vista, 7, 8, 10, and 11 natively
- Are also supported by all major browsers as favicon.ico files
The practical recommendation is to store the 256 × 256 layer (and optionally 128 × 128) as PNG, and smaller layers (16–64 px) as raw 32-bit DIB for widest compatibility.
Favicon Use in Web Development
The browser favicon is a critical web-development use case for ICO files. A favicon.ico placed at the server root is automatically requested by all browsers:
<!-- Basic -->
<link rel="icon" href="/favicon.ico" sizes="any">
<!-- Modern complement (SVG) -->
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<!-- Apple Touch Icon -->
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
Why Use ICO for Favicons Instead of PNG?
- Multi-size container — one ICO file serves 16 × 16 (address bar), 32 × 32 (browser tab), and larger sizes; PNG requires separate files per size
- Universal browser support — ICO has been supported since Netscape 5.0 (1999) and works in every browser without declaration
- Graceful degradation — older systems always find a compatible size within the ICO container
Recommended Favicon ICO Contents
For a modern website, the favicon.ico should contain:
- 16 × 16 (32-bit RGBA) — browser address bar, tab strip
- 32 × 32 (32-bit RGBA) — Windows taskbar pinned site, high-DPI address bar
- 48 × 48 (32-bit RGBA) — Windows taskbar (large icons)
Creating ICO Files
From PNG Sources
Best practice: design the icon at 256 × 256 px in a vector tool (Illustrator, Figma, Inkscape), export to PNG at each required size, then compile into an ICO. Dedicated tools and online converters (KaijuConverter) automate this compilation.
Design Considerations for Small Sizes
At 16 × 16 px, complex logos become indistinguishable. Professional icon design involves:
- Simplification — remove fine details; use bold shapes
- Pixel hinting — align critical edges to pixel grid to avoid blurry sub-pixel rendering
- Separate artwork per size — the 16 px icon is often a radically simplified version of the 256 px icon, not just a downscale
Anti-aliasing and Alpha Transparency
32-bit ICO images support smooth anti-aliased edges against a transparent background. This allows icons to blend naturally over any colour — desktop wallpapers, browser tabs, dark-mode UIs — without visible jagged edges or a fixed background colour halo.
Animated Icons (ANI Format)
Windows also supports ANI (Animated Cursor) files for animated icons used as cursors. ANI is a distinct format based on RIFF (like WAV/AVI), containing multiple ICO-like frames with per-frame timing. Standard desktop application icons use static ICO; animated icons are reserved for cursor themes.
Converting Images to ICO
PNG → ICO
The most common conversion: PNG images at multiple sizes are compiled into a single ICO container. Transparency from the PNG alpha channel is preserved in the ICO's 32-bit RGBA layers.
SVG → ICO
SVG source allows lossless rasterisation at any target size. Converting SVG to ICO involves rasterising at 16, 32, 48, 64, 128, and 256 px, then packing into ICO. This preserves maximum sharpness at every size.
JPEG → ICO
JPEG has no alpha channel, producing icons with solid (non-transparent) backgrounds. Generally unsuitable for desktop icons; acceptable only for simple solid-background logos.
Advantages and Limitations
| Aspect | Detail |
|---|---|
| Multi-size container | Yes — one file for all DPI levels |
| Alpha transparency | Full 8-bit (32-bit RGBA layers) |
| Animation | No (use ANI for animated cursors) |
| Colour accuracy | Full RGB; not HDR |
| File size | 5–100 KB for a complete modern set |
| Platform | Windows-native; browsers support favicon.ico universally |
| macOS equivalent | ICNS (Apple Icon Image) |
ICO remains the definitive icon format for Windows software and web favicons, providing a versatile multi-size container trusted across four decades of computing.