Little EndianEdit
Little endian is a method of encoding multi-byte values in computing memory and data streams in which the least significant byte of a word is stored at the smallest address. In practical terms, this means that the "little end" of a number comes first when the number is laid out in memory. This memory layout contrasts with big-endian form, where the most significant byte is stored first. The choice of endianness in a system affects how binary data are interpreted, serialized, and exchanged with other systems. For a broad overview of the concept, see endianness and, in contrast, big-endian.
The term little endianness is commonly encountered in discussions of hardware architectures, software portability, and data formats. It influences how arithmetic is performed in memory, how data is read from files, and how network protocols are implemented. A simple way to visualize it is to consider a 32-bit value such as 0x01020304: on a little-endian machine, the bytes would appear in memory as 04 03 02 01, whereas a big-endian machine would store them as 01 02 03 04. This distinction matters when data is shared between systems with different byte orders, or when reading binary formats that specify a particular endianness.
Origins and terminology
The word endianness derives from a playful reference to a literary distinction in Gulliver's Travels, where communities differ over whether eggs should be broken on the big end or the little end. In computing, the labels big-endian and little-endian were popularized to describe how multibyte values are ordered in memory and in data streams. The phrases were notably used and discussed in the context of network protocols and computer architectures; the terms were popularized by discussions among researchers such as Danny Cohen in relation to cross-platform data exchange. See also Gulliver's Travels for the literary origin of the metaphor, and big-endian for the contrasting convention.
In modern architectures
Little-endian memory layout is the default or predominant mode on many widely used processors. The dominant desktop and laptop line, based on the x86 family, stores 32- and 64-bit integers in little-endian form. This has practical implications for software development, performance tuning, and cross-language data handling on personal computers. For mobile and embedded devices, the situation is similar: most ARM architecture implementations run in little-endian mode by default, though some systems support switching endianness as needed.
Some architectures support multiple endianness modes. In those cases, the ability to switch between little-endian and big-endian can influence portability and software design. In contrast, several older or specialized systems are fixed-endian, or have historically favored big-endian layouts due to design choices or compatibility constraints. See also PowerPC and SPARC for discussions of big-endian versus little-endian tendencies in various platforms, and note that many modern designs provide mechanisms to handle both orders.
Networking and data interchange take a somewhat complementary stance. The standard network ordinal practice is to use big-endian, often referred to as network byte order. This convention avoids ambiguity when data traverse heterogeneous systems. See network byte order for details on why big-endian is used in this context and how systems convert to and from this form.
Data formats and interoperability
Endianness matters when reading or writing binary file formats. Some formats specify a particular byte order for multibyte numbers, and software must perform byte-swapping if the host endianness differs from the format’s endianness. Examples of endianness in common formats include:
- Little-endian formats: the WAV/RIFF family and many Windows-based binary files store multi-byte integers in little-endian order. See RIFF for the container used by WAV files.
- Big-endian or dual-order formats: certain image and archival formats, and some network protocols, specify big-endian ordering; see PNG for one widely used image format that uses a defined network-like ordering for chunk data in practice, and TIFF for a format that can operate in either order depending on its header.
- Text encoding and endianness: text encodings such as UTF-16 introduce endianness considerations, since the same textual code units can be represented with different byte orders. The byte order mark can indicate the encoding’s endianness for a given file or stream.
Across software, libraries and languages provide facilities to manage endianness. For example, many networking APIs expose host-to-network and network-to-host conversion functions, such as those commonly implemented as htonl and htons in POSIX environments, to translate between the host machine’s endianness and the network standard. Languages and frameworks also offer abstractions for reading and writing binary data that preserve or convert byte order as needed, enabling portable data interchange across heterogeneous systems.