Endianness describes the order in which bytes are stored in memory for multi-byte values. Multi-byte values are data types larger than one byte, such as integers. Big-endian stores the most significant byte first, while little-endian stores the least significant byte first.
Processor families were designed independently and, consequently, different designers made different choices about how bytes should be arranged in memory. When computers with different endianness exchange data, they must agree on the byte order or convert the data. Otherwise, values may be interpreted incorrectly.
Prior to 2006, most Macs used PowerPC processors while most PCs used Intel processors1. These processors differed in both instruction set architecture and byte ordering. Software compiled for one platform generally could not run directly on the other without recompilation or emulation. The Mac switch was a significant architectural change that allowed Macs to run software compiled for Intel processors (once recompiled to run natively on the new architecture)2.
đź’ˇThe endianness terms come from a literary reference about which end of an egg to crack first (see the Origin section below for more details).
Big-Endian
Big-endian stores the most significant byte at the lowest memory address. Storing files in this byte order is common in network protocols, some mainframe systems, and certain file formats such as Photoshop (PSD)3. On little-endian systems such as most Windows PCs, software may need to swap the byte order when reading or writing big-endian files.
Example: KODI
| Character | Hex |
|---|---|
| K | 0x4B |
| O | 0x4F |
| D | 0x44 |
| I | 0x49 |
Let’s store the 4 character word KODI. In ASCII, each character occupies one byte (4B 4F 44 49). Treating the characters as two 16-bit values, we have KO (0x4B4F) and DI (0x4449).
- Bytes: 4B 4F 44 49
- Characters: K O D I
Little-Endian
Little-endian stores the least significant byte at the lowest memory address. Most modern processors, including Intel x86, x86-64 use this byte order, and most modern ARM-based systems operate in this mode. Example file formats: Bitmap (BMP), GIF, and WAV.
Example: OKID
In little-endian, our example from above (storing the 4 character word KODI) looks different and each value has its bytes reversed in memory. Instead of KO as 4B 4F, it is 4F 4B.
The characters were previously stored as KO DI, now they are OK ID.
- Bytes: 4F 4B 49 44
- Characters: O K I D
Endianness affects the byte ordering within each multi-byte value. It does not reverse the entire string of bytes (KODI does not become IDOK); only the bytes within each multi-byte value are reordered.
Little-endian stores KO DI (0x4B4F 0x4449) as OK ID (0x4F4B 0x4944).
| Big-Endian | Little-Endian |
|---|---|
| KO = 4B 4F | KO = 4F 4B |
| DI = 44 49 | DI = 49 44 |
Byte Order Example
We previously looked at an example with two 16-bit values storing the characters KO and DI. Now let’s examine a 32-bit value: 0x12345678.
In a big-endian system, the bytes are stored as:
12 34 56 78
In a little-endian system, the bytes are stored as:
78 56 34 12
Regardless of the computer’s endianness, the value is still 0x12345678. The value itself does not change, only the order of its bytes in memory.
The table below simulates memory addresses where each byte is stored.
| Address | Big-Endian | Little-Endian |
|---|---|---|
| 1000 | 12 | 78 |
| 1001 | 34 | 56 |
| 1002 | 56 | 34 |
| 1003 | 78 | 12 |
Origin of Big-Endian and Little-Endian
What does the shape of an egg have to do with computer architecture?

These computer science terms originate from a reference in Gulliver’s Travels (Jonathan Swift, 1726)4. In the story, a seemingly trivial dispute over which end of an egg to crack becomes a deep political division. Big-Endians crack the large end of the egg, and Little-Endians crack the smaller end. The dispute between these two factions sparked six rebellions, costing one emperor his life and another his crown.
“It is allowed on all hands, that the primitive way of breaking eggs, before we eat them, was upon the larger end; but his present majesty’s grandfather, while he was a boy, going to eat an egg, and breaking it according to the ancient practice, happened to cut one of his fingers. Whereupon the emperor his father published an edict, commanding all his subjects, upon great penalties, to break the smaller end of their eggs.”
-Jonathan Swift, Gulliver’s Travels (1726), Part I, Chapter IV, p. 62 (PDF p. 76, archive.org)
A 1980 paper, “On Holy Wars and a Plea for Peace” by Danny Cohen5, introduced these terms from Gulliver’s Travels as a reference to byte order.
In his conclusion, he writes:
“I believe that, after all, which way is chosen does not make too much difference. It is more important to agree upon an order than which order is agreed upon.”
Additionally, after the conclusion, he adds more context about the dispute in Gulliver’s Travels, and information about the evolution of numbers in language. For example, he discusses how we write and say numbers from left-to-right in English. In contrast, languages such as Dutch6 say numbers with digits reversed. These opposing ways of speaking a number are similar to the opposing ways of storing multi-byte values.

Summary
Endianness defines how bytes are ordered and stored in a computer’s memory for multi-byte data types.
When systems with different endianness need to share data, they must agree on the byte order or perform conversions to avoid misinterpreting the data.
In summary, byte order does not reverse the entire string of bytes; only the bytes within each multi-byte value are reordered. The value itself does not change, only the order of its bytes in memory.
- Big-endian stores the most significant byte first.
- Used in mainframes, networks, and some file formats.
- Photoshop (PSD) files are this byte order. On the Windows platform, you must byte swap short and long integers when reading or writing.
- Little-endian stores the least significant byte first.
References
- Mac transition to PowerPC processors (Wikipedia)
- Mac transition to Intel processors (Wikipedia)
- Adobe Photoshop File Formats Specification, November 2019 (Adobe)
- GULLIVER’S TRAVELS into several REMOTE NATIONS OF THE WORLD (Project Gutenberg)
- On Holy Wars and a Plea for Peace by Danny Cohen (Internet Engineering Task Force)
- Why you might be counting in the wrong language (BBC)
- BMP file format (Wikipedia)
- GIF (Graphics Interchange Format) (Wikipedia)


