Endianness

Endianness is the convention a system uses for the byte order of a multi-byte value in memory or on the wire. A 32-bit integer occupies four bytes, and there are two natural ways to lay them out. Big-endian stores the most significant byte at the lowest address, so the bytes appear in the same order a human writes the number. Little-endian stores the least significant byte first, so the order is reversed. Both are correct; they are simply different agreements, and a value written by a machine using one convention will be misread by a machine that assumes the other unless the bytes are swapped.

The terms come from Danny Cohen’s 1980 note “On Holy Wars and a Plea for Peace,” circulated as IEN 137 on April 1, 1980 and later published in IEEE Computer in 1981. Cohen framed the question as “which bit should travel first, the bit from the little end of the word, or the bit from the big end of the word?” The followers of starting from the narrow end he called the Little-Endians, and those starting from the wide end the Big-Endians. He borrowed the names from Jonathan Swift’s “Gulliver’s Travels,” where Lilliput is split by a war over which end of a boiled egg to crack, a deliberate jab at how much heat the technical dispute generated relative to its real importance.

Cohen’s central argument was not that one order is superior but that interoperability demands a shared choice. As he put it, “it is more important to agree upon an order than which order is agreed upon.” This is why network protocols fix a convention: the byte order used on the internet is big-endian, commonly called network byte order, so that machines of differing native endianness can exchange data correctly. Software converts between host byte order and network byte order at the boundaries, which is the practical legacy of the holy war Cohen described.

In practice the split runs through real hardware. The x86 family is little-endian, as are most ARM deployments in their usual configuration, while older architectures such as the Motorola 68000 and SPARC, and protocols like TCP/IP, are big-endian. Some processors are bi-endian and can be configured either way. A programmer notices endianness mainly when moving raw bytes across a boundary: reading a binary file format, parsing a network packet, or sharing memory between systems that disagree. Within a single consistent machine, the order is invisible.

The deeper point Cohen made still holds. Endianness is a coordination problem, not a correctness problem. The cost of disagreement is paid in byte-swapping code, subtle bugs in serialized data, and the perennial confusion of programmers who forget which way a given format runs. That a forty-year-old essay named after an egg-cracking war remains the standard reference is a sign of how durable, and how genuinely annoying, the underlying issue is.

Sources

Last verified June 8, 2026