An ICNS file is an 8-byte header followed by elements, one after another, with nothing between them. Every number in the header and in each element’s header is big-endian.
File header
| Offset | Size | Field | Value |
|---|---|---|---|
| 0 | 4 | Magic | The letters icns, 69 63 6E 73 |
| 4 | 4 | File length | The size of the whole file in bytes, these 8 included |
Every element then follows from offset 8 to the end of the file. There is no count of elements: a reader goes on until the end.
Elements
Each element has the same 8-byte header. Its type says how to read the data, and the length includes the header, so a reader adds it to the element’s offset to reach the next one.
| Offset | Size | Field | Value |
|---|---|---|---|
| 0 | 4 | Type | Four characters, such as ic08. See every type |
| 4 | 4 | Length | The element’s size in bytes, these 8 included |
| 8 | length − 8 | Data | Depends on the type |
0Magicicns4 bytes4File length4 bytes8Element type, length, datavaries…Element type, length, datavaries
Apple does not publish an order for the elements. A file written by
iconutil on macOS 27 was not sorted by size.
TOC : table of contents
The type is the letters TOC and a space. The element holds one 8-byte entry
for each element it lists.
| Offset | Size | Field | Value |
|---|---|---|---|
| 0 | 4 | Type | The type of a listed element |
| 4 | 4 | Length | That element’s length, its 8-byte header included |
An element holding n entries is 8 + 8 × n bytes. In the files checked, it
came first and listed the picture elements in their order. It left out icnV,
name, info and any nested icon sets.
icnV: version
Four bytes, a big-endian floating point number. Independent sources say it holds the version of the Icon Composer application that made the file. In the files checked, the values were between 119 and 140, or −1. Nothing further is documented.
name
The element’s data is a short name, as plain text with no end marker. In the files checked,
the only value was icon. The icnsutil survey also reports
template and selected.
info
The element’s data is a binary property list, and starts with
bplist00. Independent sources say only its name appears to be used. In a file
written by iconutil on macOS 27, it is a keyed archive of a dictionary with the
keys name (icon) and assetcatalog-reference, which is
empty.