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.
ملفاتك لا تغادر جهازك
أسئلة شائعة
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.
ما يميز .ICO
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.
اكتشف التفاصيل التقنية
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 إلى...
المرجع التقني
- نوع MIME
image/x-icon- Magic Bytes
00 00 01 00Reserved (00 00), type 1 (icon), image count follows.- المطوّر
- Microsoft
- سنة التقديم
- 1985
- معيار مفتوح
- نعم
Reserved (00 00), type 1 (icon), image count follows.
البنية الثنائية
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.
| Offset | Length | Field | Example | Description |
|---|---|---|---|---|
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). |
نقاط الضعف
- 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
الحماية: 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.