Big-endian vs little-endian: how byte order works
Endianness is the order in which a computer stores the bytes of a value that is wider than one byte. A big-endian system puts the most significant byte at the lowest address; a little-endian system puts the least significant byte there. The terms come from Danny Cohen's 1980 note "On Holy Wars and a Plea for Peace", which borrowed them from the Big-Endians and Little-Endians of Swift's Gulliver's Travels, who went to war over which end of an egg to break. Today little-endian dominates processors: the RISC-V specification chose it because all x86 systems, and iOS, Android and Windows on Arm, are little-endian. Internet protocols describe their headers in big-endian order, which is why big-endian is also called network byte order. Neither order is better; what matters is that the writer and the reader of the bytes agree.
What each order is good at
Big-endian matches the way people write numbers, most significant digit first, so a memory dump or a packet header reads naturally from left to right, and comparing multi-byte values byte by byte works from the first byte. Little-endian keeps the least significant byte at the lowest address, so reading the low 8 or 16 bits of a wider value uses the same address as reading all of it, and multi-byte addition can start at the first byte, where the carry chain begins; the RISC-V designers also found it more natural for hardware.
Where digiwleea fits
Byte order only appears once a value is wider than the memory's unit. digiwleea's course CPU is an 8-bit machine with one byte per address, so every value it stores fits in a single byte and endianness never comes up; you build its 8-bit registers, adder and RAM from transistors up and watch each byte as a row of 0s and 1s. To see the bits and bytes of wider values, the hex calculator and bit mask calculator help, and the hexadecimal lesson explains why two hex digits make one byte.
The same number in both byte orders
Store the 32-bit value 0x12345678 at address 0x100. Each address holds one byte; the two orders put the bytes in opposite places:
| Address | Big-endian | Little-endian |
|---|---|---|
| 0x100 | 12 (most significant byte) | 78 (least significant byte) |
| 0x101 | 34 | 56 |
| 0x102 | 56 | 34 |
| 0x103 | 78 | 12 |
Only the order of whole bytes changes; the bits inside each byte stay the same. Read the bytes back in the wrong order and 0x12345678 becomes 0x78563412.
Who uses which
| Byte order | |
|---|---|
| x86 (Intel and AMD PCs) | Little-endian |
| Arm in iOS, Android and Windows on Arm | Little-endian |
| RISC-V | Chosen little-endian; big-endian and bi-endian variants are defined |
| Internet protocol headers ("network byte order") | Big-endian |
No sign-up is needed to start: open the lab and place your first transistor, or read the free theory course. The account (and the AI tutor) are optional.
More comparisons: Digital logic concepts compared
See for yourself: build a logic gate from transistors in the simulator, then follow the path from sand to an 8-bit CPU.
Open the digiwleea lab →Frequently asked
What is the difference between big-endian and little-endian?
Big-endian stores the most significant byte of a multi-byte value at the lowest memory address; little-endian stores the least significant byte there. 0x12345678 is stored as 12 34 56 78 in big-endian and 78 56 34 12 in little-endian.
Is x86 big-endian or little-endian?
Little-endian. The RISC-V specification notes that all x86 systems are little-endian, as are iOS, Android and Windows on Arm.
What is network byte order?
Big-endian. Internet protocol documents picture data in big-endian order, most significant byte first, so programs convert values to and from that order when they build or read packet headers.
Where do the names big-endian and little-endian come from?
From Danny Cohen's 1980 note "On Holy Wars and a Plea for Peace", which took them from Gulliver's Travels, where the Big-Endians and Little-Endians fight over which end of a boiled egg to break.
Does endianness change the order of bits?
Not in memory: endianness is about the order of whole bytes. The bits inside each byte keep their meaning; only which byte sits at which address changes.