Endianness
Published Jun 29, 2022
Contribute to Docs
Endianness describes the order in which bytes are stored in memory for multi-byte values. The options are generally described as big-endian or little-endian. A big-endian system stores the most significant byte at the smallest memory address and the least significant byte at the largest. A little-endian system stores the least significant byte at the smallest memory address and the most significant byte at the largest.
Example
To store the 32-bit integer 0x0A0B0C0D, it is broken down into four bytes:
0x0A0x0B0x0C0x0D
The endianness of the computer system defines in what order these bytes are stored in memory. The following examples show it stored at memory address 0xFFF0 for both big- and little-endian systems:
Big-endian
| Address | Value |
|---|---|
0xFFF0 |
0x0A |
0xFFF1 |
0x0B |
0xFFF2 |
0x0C |
0xFFF3 |
0x0D |
Little-endian
| Address | Value |
|---|---|
0xFFF0 |
0x0D |
0xFFF1 |
0x0C |
0xFFF2 |
0x0B |
0xFFF3 |
0x0A |
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn General on Codecademy
- Start your programming journey with an introduction to the world of code and basic concepts.
- Includes 5 Courses
- With Certificate
- Beginner Friendly.4 hours
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours