Everything you need to know about ICO
ICO (Microsoft Icon, .ico) is Windows' native icon format, around since Windows 1.0 in 1985. A single .ico file can contain multiple resolutions and color depths of the same icon - 16x16, 32x32, 48x48, 256x256 - and Windows picks the right one for the context. Today its main use is as the favicon at the root of every website.
How it works under the hood
- Multi-resolution container. One .ico file holds N images at different sizes. Browser asks for favicon, gets the closest size match.
- Two embedding formats. Each image can be a BMP-style bitmap with mask OR (since Vista) a full PNG. PNG embedding is what makes 256x256 icons feasible.
- Color depths. From 1-bit B&W up to 32-bit ARGB. Modern icons are nearly always 32-bit PNG embedded.
- Browser favicon convention. Browsers automatically request `/favicon.ico` from any site root - faster than waiting for the HTML to declare a `<link rel='icon'>`.
Where you'll actually use it
- Website favicons (the single biggest use today)
- Windows desktop application icons (.exe embeds .ico resources)
- Windows shortcut icons
- Legacy compatibility with older browsers (IE only requested /favicon.ico)
How it compares to alternatives
ICO vs SVG favicon: SVG scales infinitely and is tiny, but Safari and older browsers want ICO. ICO vs PNG favicon: PNG works in modern browsers but ICO covers all bases. Best practice: ship both.
Things that will trip you up
- Don't include sizes larger than 64x64 unless you also include smaller ones - older browsers may pick the largest and downscale poorly
- Some CDNs misinterpret .ico MIME types - serve as `image/x-icon` or `image/vnd.microsoft.icon`
- Updated favicons can be cached aggressively - bust with `?v=2` query string after redesign