Aladdin Systems never published the StuffIt formats. What is known comes from
reverse engineering, mainly the notes kept with The Unarchiver’s XADMaster library
(the wiki pages
StuffItFormat,
StuffIt5Format and
StuffItSpecs, which lists one line per method)
and its source (XADStuffItParser.m, XADStuffIt5Parser.m,
XADStuffItHuffmanHandle.m, XADRLE90Handle.m, XADCompressHandle.m,
XADStuffIt13Handle.m, XADStuffItArsenicHandle.m), all read 2026-11-13. Where the wiki and
the source disagree, both are shown. Fields marked unknown are unknown to that work too. All
numbers are big-endian, and dates are classic Mac OS times: seconds since
1 January 1904, local time.
Classic StuffIt archive header
Used by StuffIt 1.x to 4.x.
| Offset | Size | Meaning |
|---|---|---|
0 | 4 | First magic: SIT!, ST46, ST50, ST60, ST65, STin, STi2, STi3 or STi4. |
4 | 2 | Number of files. Its exact meaning is unclear; it may count only the top level. |
6 | 4 | Total size of the archive. |
10 | 4 | Second magic: 72 4C 61 75, rLau, for Raymond Lau. |
14 | 1 | Version; its meaning is unclear. |
15 | 7 | Unknown. |
The first file header follows at offset 22.
Classic StuffIt file header
Always 112 bytes.
| Offset | Size | Meaning |
|---|---|---|
0 | 1 | Resource fork method: see method byte. |
1 | 1 | Data fork method. |
2 | 1 | File name length. |
3 | 63 (wiki) or 31 (source) | File name (Mac Roman). The wiki gives a 63-byte field; the XADMaster parser reads at most 31 characters (namelen is capped at 31) and its source comments assign offsets 34 to 65 to other fields (name CRC at 34, an unknown 16-bit value “always 0x0986?” at 36, unknown rsrc and data long values at 38 and 42, unknown data and rsrc bytes at 46 and 47, number of items in a folder at 48, offsets of the previous (50), next (54), parent (58) and first child (62, −1 for files) entries), which the parser does not use. |
66 | 4 | Mac OS file type, such as TEXT. |
70 | 4 | Mac OS creator code. |
74 | 2 | Finder flags. |
76 | 4 | Creation date. |
80 | 4 | Modification date. |
84 | 4 | Resource fork length, uncompressed. |
88 | 4 | Data fork length, uncompressed. |
92 | 4 | Resource fork length, compressed. |
96 | 4 | Data fork length, compressed. |
100 | 2 | Resource fork CRC-16. |
102 | 2 | Data fork CRC-16. |
104 | 6 | Unknown per the wiki. The source names them: 104 resource fork padding bytes for encryption, 105 data fork padding bytes for encryption, 106 unknown data value (“always 0?”), 107 unknown data value (“always 4 for encrypted?”), 108 unknown resource value (“always 0?”), 109 unknown resource value (“always 4 for encrypted?”). |
110 | 2 | CRC-16 of the header. |
The compressed resource fork follows the header, then the compressed data fork; the next header starts right after them.
Method byte
| Bits or value | Meaning |
|---|---|
| Bits 0 to 3 | Compression method, 0 to 15. |
Bit 4 (10) | Wiki: the data is encrypted, algorithm unknown. In the source this bit (StuffItFolderContainsEncrypted) marks a folder that contains encrypted items; the encrypted flag is bit 7 (80, StuffItEncryptedFlag), and the method is the byte with bit 7 cleared. The source finds a folder start or end after masking both bits (~(80|10)). |
Bit 7 (80) | The fork is password-protected (source). The last 16 bytes of the fork’s compressed data are an entry key; the parser derives a key (XADStuffItDESHandle, a DES-based decryptor) from the password, the entry key and an MKey resource in the archive’s resource fork, and the padding byte at 104 or 105 says how much of the last block to discard. The key derivation is in XADStuffItDESHandle.m, not covered here. |
32 (20 hex) | Start of a folder: the name field holds the folder’s name; the entries up to the matching end marker are inside it. |
33 (21 hex) | End of a folder. |
StuffIt 5 archive header
StuffIt 5.0 (1997) and later write this layout by default.
| Offset | Size | Meaning |
|---|---|---|
0 | 80 | Text: StuffIt (c)1997-, a year, Aladdin Systems, Inc. and a web address, ending with 0D 0A. The characters after 1997- vary between versions. |
80 | 4 | Unknown. |
84 | 4 | Total size of the archive. |
88 | … | The wiki table lists two fields at offset 84 (a typo) and “offset of first entry header” without a place. The source parser, reading after the 80-byte text, skips 2 bytes, reads the version (82) and a flags byte (83), the total size (84), a 4-byte unknown (88), the number of entries in the root directory (92, 16 bits), the offset of the first entry (94, 32 bits; the header length) and a 16-bit CRC (98). Flags 83: 10 14 more bytes follow, 20 a comment size and a second length follow and then that data, 40 a list of further records, 80 the archive is encrypted (a hash length byte and the hash follow). The comments in the source give a 40-bit (5-byte) key length for the encryption. |
StuffIt 5 entry header
| Offset | Size | Meaning |
|---|---|---|
0 | 4 | Identifier A5 A5 A5 A5. |
4 | 1 | Version; the notes mention versions 1 and 3. |
5 | 1 | Unknown. |
6 | 2 | Header size. |
8 | 1 | Unknown. |
9 | 1 | Flags: bit 5 (20) encrypted, algorithm unknown; bit 6 (40) a folder. |
10 | 4 | Creation date. |
14 | 4 | Modification date. |
18 | 4 | Offset of the previous entry. |
22 | 4 | Offset of the next entry, from the start of the file. |
26 | 4 | Offset of the parent folder’s entry. |
30 | 2 | Name length. |
32 | 2 | Header CRC-16. |
34 | 4 | Data fork length, uncompressed. In a folder entry, FFFFFFFF marks a special entry of unknown purpose that readers skip. |
38 | 4 | Data fork length, compressed. |
42 | 2 | Data fork CRC-16; zero for method 15. |
44 | 2 | Unknown. |
46 | 1 or 2 | File: data fork method (1 byte), then the length N of password data (1 byte). Folder: number of entries in it (2 bytes). |
48 | N | Password information; meaning unknown. |
| 48 + N | M | Name. |
| … | 2 | Comment length K. |
| … | 2 | Unknown. |
| … | K | Comment. |
Second header
A file entry continues with a second part, then the compressed resource fork, then the compressed data fork.
| Offset | Size | Meaning |
|---|---|---|
0 | 2 | Flags 2: bit 0 set when a resource fork is present. |
2 | 2 | Unknown. |
4 | 4 | Mac OS file type. |
8 | 4 | Mac OS creator code. |
12 | 2 | Finder flags. |
14 | 2 | Unknown. |
16 | 4 | Unknown; possibly a date in version 3. |
20 | 12 | Unknown. |
32 | 4 | Unknown; present in entry version 1, absent in version 3. |
| 32 or 36 | 4 | Resource fork length, uncompressed (only with a resource fork, as are the next four). |
| 36 or 40 | 4 | Resource fork length, compressed. |
| 40 or 44 | 2 | Resource fork CRC-16; zero for method 15. |
| 42 or 46 | 2 | Unknown. |
| 44 or 48 | 1 | Resource fork method. |
| 45 or 49 | 1 | Unknown. |
Compression methods
| Method | XADMaster name | Algorithm |
|---|---|---|
0 | – | Stored, no compression. |
1 | Rle90Algorithm | Run-length encoding with the 90 hex escape byte, as in BinHex. |
2 | CompressAlgorithm | LZW as in Unix compress, 14-bit codes, block mode. |
3 | StuffItAlgorithm3 | Simple Huffman coding of bytes. |
5 | StuffItAlgorithm5 | Called “LZAH” in the notes. Not described further. |
8 | StuffItAlgorithm8 | Miller–Wegman LZ. Not described further. |
13 | StuffItAlgorithm13 | LZSS with Huffman coding. |
14 | StuffItAlgorithm14 | Listed with no description; XADMaster has a decoder for it. |
15 | StuffItArsenicAlgorithm | Arsenic: block sorting (Burrows–Wheeler) and arithmetic coding. |
Methods 4, 7 and 9 to 12 are not known to be used. The parser’s name list also has method 6, “Fixed Huffman”, which it does not decode (a comment says it is unclear), and calls method 14 “Installer” and method 5 “LZAH”, decoded by its dynamic LZH handler. The notes give one line per method; the decoders in XADMaster are the only full description. What the source shows, for the five methods it makes clearest:
- 1, RLE90. Bytes are copied; the byte
90is an escape.90 00is a literal90;90 01is an error;90 n(n ≥ 2) repeats the previous output byte n − 2 more times. - 2, compress. The Unix LZW of .Z read with the flag byte
8E(block mode, maximum 14-bit codes), least significant bit first, with the compress “clear” code 256: after a clear the reader skips the bits that pad the symbol count to a multiple of 8 symbols, as in the ncompress tools. - 3, Huffman. The tree comes first, as a bit tree read depth first: a 1 bit is a leaf followed by 8 bits of the byte value; a 0 bit is an internal node followed by its 0 branch’s subtree, then its 1 branch’s. The data is then codes read bit by bit from that tree. (Bits are read most significant first.)
- 13, LZSS with Huffman. A 64 KiB window. Bit order least significant first. The first byte holds a table
number in its high 4 bits: 1 to 5 select one of five built-in sets of three code length tables (literal/length after a
literal, literal/length after a match, and offsets; 321 symbols each, 11, 13, 14, 11 and 11 offset symbols), listed in
XADStuffIt13Handle.mand not reproduced here; 0 means the tables follow in the stream, with bit 3 of that byte set to reuse the first table as the second and the low 3 bits giving the offset table size (value + 10). Streamed tables are coded with a fixed 37-symbol “meta” code: values 0 to 30 set the running length to value + 1 and store it for this symbol; 31 sets the running length to −1 and stores that for this symbol; 32 increments the running length and 33 decrements it, then store it; 34 stores the running length, and once more for the next symbol if the next bit is 1; 35 stores it for 3 to 10 symbols in all (3 bits + 3); 36 stores it for 11 to 74 symbols (6 bits + 11). The meta codes are 0x5d8, 0x058, 0x040, 0x0c0, 0x000, 0x078, 0x02b, 0x014, 0x00c, 0x01c, 0x01b, 0x00b, 0x010, 0x020, 0x038, 0x018, 0x0d8, 0xbd8, 0x180, 0x680, 0x380, 0xf80, 0x780, 0x480, 0x080, 0x280, 0x3d8, 0xfd8, 0x7d8, 0x9d8, 0x1d8, 0x004, 0x001, 0x002, 0x007, 0x003, 0x008 with lengths 11, 8, 8, 8, 8, 7, 6, 5, 5, 5, 5, 6, 5, 6, 7, 7, 9, 12, 10, 11, 11, 12, 12, 11, 11, 11, 12, 12, 12, 12, 12, 5, 2, 2, 3, 4, 5 (low bit first). Decoding: a symbol below 256 is a literal and the next symbol uses the first table; otherwise the next uses the second. 256 to 317 (0x13d) give a match length of symbol − 256 + 3 (3 to 64); 318 (0x13e) a length of 10 bits + 65; 319 (0x13f) a length of 15 bits + 65; 320 ends the data. The offset is then a symbol b from the offset table: 0 gives 1, 1 gives 2, otherwise(1 << (b − 1)) + (b − 1 bits) + 1. - 15, Arsenic. An adaptive arithmetic coder (26-bit range, frequency models that halve when the total passes a
limit) around a Burrows–Wheeler transform with move-to-front coding. The stream starts with the characters
Aands, then 4 bits (+ 9) giving the block size as a power of two (29 to 224), then an end-of-blocks flag. Each block has a randomisation flag, the BWT start index (as many bits as the block size exponent), then symbols from a selector model (0 and 1 count runs of zeros in a bit-doubling way, 2 is the symbol 1, 3 to 9 select one of seven move-to-front models covering the symbol ranges 2–3, 4–7, 8–15, 16–31, 32–63, 64–127 and 128–255, 10 ends the block). After the block the end flag may be followed by a 32-bit CRC of the whole output (CRC-32, polynomial EDB88320, inverted at the end). Decoding applies the inverse BWT, undoes the “randomisation” (a table of 256 offsets after which a byte is XORed with 1) and then a final run-length step: four equal bytes are followed by a count byte, and a count of 0 skips it. The model start values and increments are inXADStuffItArsenicHandle.m.
CRC-16
The wiki gives the CRC as CRC-16 with the CCITT polynomial 1021 and no
starting or final inversion. The source disagrees: XADStuffItParser.m checks the 112-byte classic header’s CRC at
offset 110 against the first 110 bytes using the table XADCRCTable_a001 (the reflected polynomial A001, that is
CRC-16/ARC, “IBM CRC-16”), starting from 0; and it checks the fork CRCs with the same IBM CRC-16 “not conditioned”, over the decompressed
fork (except for method 15, whose CRC field is zero and which has its own CRC-32). For StuffIt 5, the source comments say the header CRC is
the CRC-16 of the header (its size given at offset 6) with the CRC field cleared; the entry’s polynomial is not stated there.