FourCC

A FourCC ("four-character code") is a sequence of four bytes (typically ASCII) used to uniquely identify data formats.

It originated from the OSType or ResType metadata system used in classic Mac OS and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives.

Filesystem-associated type codes are not readily accessible for users to manipulate, although they can be viewed and changed with certain software, most notably the macOS command line tools GetFileInfo and SetFile which are installed as part of the developer tools into /Developer/Tools, or the ResEdit utility available for older Macs.

FourCC is written in big endian relative to the underlying ASCII character sequence, so that it appears in the correct byte order when read as a string.

Many C compilers, including GCC, define a multi-character literal behavior of right-aligning to the least significant byte, so that '1234' becomes 0x31323334 in ASCII.

For audio coding formats, AVI and WAV files use a two-byte identifier, usually written in hexadecimal (such as 0055 for MP3).

In QuickTime files, these two-byte identifiers are prefixed with the letters "ms" to form a four-character code.