The Same Number Can Have Two Byte Layouts

A byte is an eight-bit unit, and many values—such as a 32-bit integer—take up several bytes. Endianness determines how those bytes are placed in memory addresses that increase from one location to the next.

Take the hexadecimal value `0x12345678`, which consists of four bytes: `12`, `34`, `56`, and `78`. In big-endian order, the most significant byte—the one carrying the largest place value—comes first: `12 34 56 78`. In little-endian order, the least significant byte comes first: `78 56 34 12`. The numeric value is unchanged; only its byte arrangement differs.

Why Agreement Matters

If a program reads those bytes using the wrong convention, it groups them into a different number. A little-endian machine interpreting the big-endian sequence above as a little-endian integer, for example, would read `0x78563412` instead of `0x12345678`.

That is why software that exchanges multi-byte values must agree on a byte order or explicitly convert between them. File formats and network protocols can specify an order, allowing programs on different machines to interpret the same stored bytes consistently. The issue applies to multi-byte values, not to the order of the bits inside an individual byte.

A Small Choice With Practical Consequences

Endianness is usually invisible when a program works entirely within one system: the processor and software already share conventions. It becomes important at boundaries—when data is saved, transmitted, or interpreted by different systems. A few bytes that look like an arbitrary sequence can therefore determine whether a value survives the trip intact.