What is the ICNS file format?
.icns is a binary container format used by macOS. .icns files store various icons used by applications. Each application can have its own icon file, typically saved in the Contents/Resources/ directory of the app bundle. References to .icns files are also listed in .plist configuration files. Icons in .icns files can be viewed using the macOS Finder or by opening them with any compatible image viewer.
The .icns format supports icons of various sizes, such as 16×16, 32×32, 128×128, 256×256, 512×512 and 1024×1024 on newer systems. Older, smaller icon elements store 24-bit color with an 8-bit alpha mask using run-length encoding. Elements at 256×256 and above embed a full .png image - or JPEG 2000 - delivering 32-bit RGBA at Retina resolution.
The file opens with the 4-byte ASCII magic icns followed by a 4-byte big-endian total file length. The body is a series of icon elements, each identified by a 4-byte OSType tag - for example ic09 for 512×512 and ic10 for 1024×1024. To assemble an .icns file from source images, macOS provides the iconutil command-line tool: place correctly named .png files in an .iconset folder and run iconutil -c icns MyIcon.iconset. The format serves the same purpose on macOS as the .ico file does on Windows.
Security & safety
RISK: LOWAn .icns is image data, not executable code, so a genuine icon file is safe to open in a viewer. Two minor cautions: image PARSERS have historically had bugs (a malformed icon could in theory crash an image library), so keep your OS/viewer updated; and an unexpected "icon" that asks to RUN, or an executable disguised with an icon-looking name, should be treated with suspicion. For app icons and downloaded icon packs from normal sources there is essentially no risk.
Format details
in a nutshellPrograms that open ICNS files
Technical details
deep spec| File magic | `icns` (0x69 0x63 0x6E 0x73) at offset 0 |
| Header structure | 4-byte magic + 4-byte big-endian total file length, followed by a series of icon elements |
| Byte order | Big-endian for all multi-byte integers |
| Icon element format | {4-byte OSType tag, 4-byte element length, data} - one block per size/variant |
| Small element encoding | Run-length encoding (RLE) for 24-bit color bitmaps (`is32`, `il32` and similar legacy types) |
| Large element encoding | Embedded PNG or JPEG 2000 for elements at 256×256 and above |
| Color depth | 24-bit color + 8-bit alpha mask (RLE elements); 32-bit RGBA via embedded PNG (modern elements) |
| Supported canvas sizes | 16×16, 32×32, 128×128, 256×256, 512×512, 1024×1024 (also 512×512@2× Retina) |
| Common OSType tags | `ic07` 128×128, `ic08` 256×256, `ic09` 512×512, `ic10` 1024×1024, `is32`/`il32` legacy 16/32 px |
| MIME type | `image/icns`; also registered as `image/x-icns` |
| App bundle location | `Contents/Resources/<AppName>.icns` inside a macOS `.app` bundle |
| Build toolchain | `iconutil -c icns MyIcon.iconset` converts an `.iconset` folder of PNG files into a single `.icns` file |
| Optional TOC element | An optional `TOC ` element (with trailing space) at the start of the element list enables fast seeking without a full file scan |
| Integrity mechanism | Per-element length fields and 4-byte file-length header; no cryptographic checksum |
| Typical file size | A few KB (minimal size set) to several hundred KB (full Retina size set) |
| Released | 1998 (Mac OS 8.5); replaced the classic resource-fork 'icns' icon resource as a standalone file |
| Latest version | Retina/HiDPI variants and PNG/JPEG2000-compressed elements up to 1024x1024 (since macOS 10.7 Lion, 2011) |
| Specification | en.wikipedia.org |
ICNS conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about ICNS files.