Endianness describes the order in which bytes are stored in memory for multi-byte values. It defines the order in which bytes are arranged for data types larger than one byte, such as integers.
Processor families were designed independently, and 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 processors. 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).
đź’ˇThe terms big-endian and little-endian come from a literary reference about which end of an egg to crack first (see “Origin of Big-Endian and Little-Endian” below for more details).
Big-Endian
Big-endian stores the most significant byte at the lowest memory address. Storing files in big-endian byte order is common in network protocols, some mainframe systems, and certain file formats such as Photoshop (PSD). On little-endian systems such as most Windows PCs, software may need to swap the byte order when reading or writing big-endian files.
Big-Endian 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 little-endian mode. Examples of little-endian file formats: Bitmap (BMP), GIF, and WAV.
Little-Endian Example: OKID
In little-endian, our example from above (storing the 4 character word KODI) looks different. Each value has its bytes reversed in memory. Instead of KO as 4B 4F, it is 4F 4B.
Instead of the characters stored as KO DI, 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. What changes is how the bytes are arranged in memory. The value itself does not change, only the order of its bytes in memory.
The byte order becomes easier to understand when we look at the 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?

The computer science terms big-endian and little-endian originate from Gulliver’s Travels (Jonathan Swift, 1726). 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)
The terms big-endian and little-endian were first referenced in relation to byte order in a 1980 paper.

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.
Endianness affects the byte ordering within each multi-byte value. It 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.
- Read from left-to-right.
- Used in mainframes, networks, and some file formats.
- Photoshop (PSD) files are big-endian byte order. On the Windows platform, you must convert from big-endian (byte swap short and long integers) when reading or writing.
- Little-endian stores the least significant byte first.
- Read from right-to-left.
- Used in processor architectures like Intel x86 and ARM
- Most modern PCs and laptops are little-endian.
- Little-endian file formats:
- Bitmap (BMP)
- Graphics Interchange Format (GIF)
Learn More
- Read GULLIVER’S TRAVELS into several REMOTE NATIONS OF THE WORLD (Project Gutenberg)
- What is endian? (Lenovo)
- Endianness (Mozilla)
- Endianness (Wikipedia)
- Mac transition to Intel processors (Wikipedia)
- Mac transition to Apple silicon (Wikipedia)
- Core Endian (deprecated, Apple)
- bigEndian (Swift documentation, Apple)
- File formats

