.ICO Windows Icon
.ico

Windows Icon

Convert ICO icon files to PNG, JPG, or WebP directly in your browser — no upload, no server, no installs. FileDex extracts the largest image from the multi-size icon container and re-encodes it locally via the Canvas API.

Learn more ↓
Image structure
Header signature
Meta dimensions · color
Pixels image data
Multi-Size ContainerBMP / PNG EmbeddedAlpha ChannelFavicon1985
By FileDex

Your files never leave your device

Common questions

What sizes should I include in a favicon.ico file?

Include 16x16, 32x32, and 48x48 at minimum. Add 64x64 and 256x256 (PNG-compressed) for high-DPI displays and Windows taskbar jumbo icons. The browser selects the closest match to the display context.

Can I use a PNG file as a favicon instead of ICO?

Yes. All modern browsers accept PNG favicons via <link rel="icon" type="image/png" href="favicon.png">. ICO is only required for compatibility with IE10 and earlier, which ignores non-ICO favicon declarations.

Why is my ICO file so large?

ICO files contain multiple images at different sizes. Large icons (128x128, 256x256) stored as uncompressed BMP consume significant space. Ensure 256x256 entries use PNG compression — this alone can reduce a 500 KB ICO to under 100 KB.

Does converting ICO to PNG lose quality?

No. The conversion extracts the embedded raster image data and wraps it in a PNG container. If the ICO entry is BMP-encoded, the raw pixel data transfers losslessly. If it is already PNG-encoded, the data is copied directly.

What makes .ICO special

Favicon files pack multiple image resolutions into a single binary container, solving a problem that dates to Windows 3.0 in 1990: how to ship one file that renders crisply at 16×16 on a taskbar, 32×32 on a desktop shortcut, and 256×256 in Explorer's tile view. The ICO format is not an image codec. It is a directory structure wrapping independent bitmap entries, each encoded as either a raw BMP or an embedded PNG.

Continue reading — full technical deep dive

Binary structure

An ICO file opens with a 6-byte header: a reserved field (always 0), a type field (1 for ICO, 2 for CUR), and a count of contained images. Following the header, each image gets a 16-byte directory entry specifying width, height, color depth, and a byte offset pointing to where the image data starts in the file. The parser reads the directory, picks the best match for the requested size, and decodes only that entry.

BMP entries store raw pixel rows bottom-up with a 40-byte BITMAPINFOHEADER. They include an AND mask (1-bit transparency) on top of the XOR color data. This dual-mask approach predates alpha channels — it allowed Windows 3.x to punch transparent holes in icons without per-pixel alpha.

PNG compression inside ICO

Windows Vista added PNG compression support inside ICO containers — a 256×256 favicon using embedded PNG is 5–10× smaller than the equivalent uncompressed BMP variant within the same .ico file. The format detection is implicit: if the image data at the directory offset starts with the PNG magic bytes (0x89 0x50 0x4E 0x47), the renderer decodes it as PNG. Otherwise it falls back to BMP parsing. This means a single .ico can mix BMP entries for small sizes and PNG entries for large ones.

Entry Format Typical size
16×16, 32-bit BMP 1.1 KB
32×32, 32-bit BMP 4.2 KB
48×48, 32-bit BMP 9.4 KB
256×256, 32-bit BMP 270 KB
256×256, 32-bit PNG 18–40 KB

The size difference at 256×256 is dramatic. Every modern favicon generator embeds the large sizes as PNG.

Browser behavior and modern alternatives

Browsers request /favicon.ico by default if no <link rel="icon"> tag exists. Chrome, Firefox, and Safari all parse multi-entry ICO files correctly, selecting the closest resolution to the tab bar's display density. Chrome on desktop targets 32×32 at 2× DPI; on Android it ignores .ico entirely and prefers the <link rel="icon" sizes="192x192"> PNG declared in HTML.

Modern practice pairs a small .ico (containing 16×16 and 32×32 BMP entries, total ~5 KB) with separate PNG and SVG favicons declared via <link> tags. Apple requires a 180×180 PNG for apple-touch-icon. The .ico remains necessary only for legacy browser fallback and Windows shortcut rendering.

Limitations

ICO has no animation support — animated favicons use APNG or GIF referenced through <link> tags, not .ico. Maximum image dimension per entry is 256×256; Windows ignores anything larger. Color depth tops out at 32-bit RGBA (8 bits per channel). There is no metadata, no EXIF, no ICC color profile. The format carries no compression for BMP entries, so multi-entry files with all BMP data balloon quickly. And macOS Finder does not render .ico files natively — it requires ICNS for dock and Finder icons.

When to use ICO vs alternatives

Use .ico when targeting Windows desktop shortcuts, legacy browsers, or corporate intranet environments running older IE versions. For web-only projects, a 32×32 PNG favicon with an SVG fallback covers all modern browsers at smaller total payload. Convert to ICO only when the deployment target specifically requires it.

.ICO compared to alternatives

.ICO compared to alternative formats
Formats Criteria Winner
.ICO vs .PNG
Favicon usage
ICO embeds multiple sizes (16x16, 32x32, 48x48, 256x256) in one file, letting the browser pick the best match. PNG favicons require a single size or multiple <link> tags.
ICO wins
.ICO vs .SVG
Scalability for icons
SVG icons scale to any resolution without pixelation. ICO is raster-based and requires pre-rendered sizes. SVG favicons are supported in modern browsers but not in IE or older Edge.
SVG wins
.ICO vs .ICNS
Cross-platform icon format
ICO is the Windows icon standard. ICNS is the macOS equivalent. Neither is portable — applications targeting both platforms must ship both formats or use PNG/SVG.
Draw

Technical reference

MIME Type
image/x-icon
Magic Bytes
00 00 01 00 Reserved (00 00), type 1 (icon), image count follows.
Developer
Microsoft
Year Introduced
1985
Open Standard
Yes
0000000000000100 ....

Reserved (00 00), type 1 (icon), image count follows.

Binary Structure

ICO files begin with a 6-byte ICONDIR header: 2 bytes reserved (must be 0), 2 bytes type (1 for icon, 2 for cursor), and 2 bytes image count. This is followed by an array of 16-byte ICONDIRENTRY structures, one per embedded image, specifying width, height, color count, reserved byte, color planes, bits per pixel, data size, and data offset. Each image entry points to either raw BMP pixel data (without the standard 14-byte BMP file header — only the DIB header and pixels) or a complete embedded PNG file. Modern ICO files use PNG compression for 256x256 icons while storing smaller sizes as BMP data. Width and height of 0 in the directory entry means 256 pixels.

OffsetLengthFieldExampleDescription
0x00 2 bytes Reserved 00 00 Must be zero. Non-zero values indicate a corrupt or non-ICO file.
0x02 2 bytes Type 01 00 Resource type. 1 = icon (.ico), 2 = cursor (.cur).
0x04 2 bytes Image count 06 00 Number of images in the file. Each gets an ICONDIRENTRY.
0x06 1 byte Width 30 Image width in pixels. 0 = 256 pixels.
0x07 1 byte Height 30 Image height in pixels. 0 = 256 pixels.
0x08 1 byte Color count 00 Number of colors in palette. 0 = no palette (true color or PNG).
0x09 1 byte Reserved 00 Reserved. Should be 0.
0x0A 2 bytes Color planes 01 00 Color planes (ICO) or hotspot X (CUR). Should be 0 or 1 for icons.
0x0C 2 bytes Bits per pixel 20 00 Bits per pixel. 32 = BGRA with alpha channel.
0x0E 4 bytes Image data size A8 24 00 00 Size of the image data in bytes.
0x12 4 bytes Image data offset 96 00 00 00 Absolute offset from file start to image data (BMP DIB or PNG).
1985ICO format introduced with Windows 1.0 for desktop and application icons1995Windows 95 standardizes 32x32 and 16x16 icon sizes with 256-color support2001Windows XP introduces 32-bit RGBA icons with full alpha channel transparency2006Windows Vista adds 256x256 icon size with PNG compression inside ICO container2012HTML5 favicon specification solidifies ICO as the standard favicon.ico format across all browsers
Extract largest image from ICO to PNG imagemagick
magick convert input.ico[0] output.png

Extracts the first (typically largest) image from the ICO container and saves it as PNG. Use [1], [2], etc. to extract other sizes. ImageMagick reads both BMP-encoded and PNG-encoded ICO entries.

Create ICO from PNG with multiple sizes imagemagick
magick convert input.png -resize 256x256 -define icon:auto-resize=256,128,64,48,32,16 output.ico

Generates a multi-size ICO file from a single PNG source. The icon:auto-resize directive creates all specified sizes automatically. Source should be at least 256x256 for best quality.

Identify all sizes embedded in an ICO file imagemagick
magick identify input.ico

Lists each image in the ICO container with its dimensions, color depth, and format (BMP or PNG). Useful for auditing favicon.ico contents before deployment.

ICO PNG export lossless PNG is the universal web image format with alpha transparency. Extracting the highest-resolution image from an ICO container to PNG allows use in HTML, CSS, app stores, and design tools that do not read ICO.
ICO JPG transcode lossy JPEG output is useful for icon previews on platforms that do not support transparency. The alpha channel is flattened to a solid background color during conversion.
ICO WEBP transcode variable WebP supports both lossy and lossless modes with alpha transparency, producing smaller files than PNG. Favicons converted to WebP reduce page weight for browsers that accept WebP favicons.
LOW

Attack Vectors

  • Crafted ICONDIRENTRY with inflated image data size can trigger large memory allocation in decoders
  • Malformed BMP DIB header within ICO entry (negative height, extreme bit depth) can trigger parser bugs
  • Image count field set to a large value causes excessive directory parsing before reaching actual data

Mitigation: FileDex decodes ICO entirely in the browser sandbox via Canvas API. The browser's built-in ICO decoder validates header fields and rejects malformed entries. No server upload occurs.

ImageMagick tool
CLI image processor with ICO read/write, multi-size creation, and individual frame extraction
GIMP tool
Open-source image editor that exports ICO with selectable sizes and bit depths per frame
IcoFX tool
Dedicated Windows icon editor with drag-and-drop multi-size ICO creation
sharp library
Node.js image processing library with ICO input support via libvips