little endian
Little endian is a byte order that stores the small end of a number first, placing the least significant byte of a multibyte value at the lowest memory address. The reverse convention, big endian, stores the most significant byte first. Which of the two a system follows is called its endianness.
Byte order only matters for values wider than a single byte. A 32-bit integer written in hexadecimal as 12 34 56 78 occupies four bytes, which a little-endian system lays out in memory as 78 56 34 12, while a big-endian system keeps the original 12 34 56 78 order. Here 78 is the least significant byte, the one with the smallest place values, like a decimal number’s ones digit. The two conventions read the same bytes from opposite ends:
Most modern hardware is little endian, including x86-64 processors and ARM chips in their default mode. The order becomes visible only when raw bytes leave the machine, in a file or over a network.
Network protocols conventionally transmit multibyte values most significant byte first, a convention called network byte order, so every binary file format and wire protocol has to pick and document one order. Reading the bytes back with the wrong one silently produces a different value rather than an error.
The names come from Jonathan Swift’s Gulliver’s Travels, where two factions feud over which end of a boiled egg to crack, and Danny Cohen borrowed them for byte order in a 1980 essay. In Python, the sys module reports the running machine’s native order as sys.byteorder, and the struct module selects an order explicitly with its "<" and ">" format prefixes.
Related Resources
Course
Binary, Bytes, and Bitwise Operators in Python
In this course, you'll learn how to use Python's bitwise operators to manipulate individual bits of data at the most granular level. With the help of hands-on examples, you'll see how you can apply bitmasks and overload bitwise operators to control binary data in your code.
For additional information on related topics, take a look at the following resources:
- Unicode & Character Encodings in Python: A Painless Guide (Tutorial)
- Bitwise Operators in Python (Tutorial)
- Bytes Objects: Handling Binary Data in Python (Tutorial)
- Python's Bytearray: A Mutable Sequence of Bytes (Tutorial)
- How to Convert Bytes to Strings in Python (Tutorial)
- Unicode in Python: Working With Character Encodings (Course)
- Bitwise Operators in Python (Quiz)
- Python Bytes (Quiz)
- Python's Bytearray (Quiz)
- How to Convert Bytes to Strings in Python (Quiz)
By Martin Breuss • Updated Sept. 7, 2026