Diagram comparing big-endian and little-endian byte order in memory with simple hexadecimal examples.

Byte Storage Order

Big or little endian byte storage order

Multi-byte integers occupy several memory locations. Values here are signed (two’s complement). Big-endian stores the most significant byte at the lowest address; little-endian stores the least significant byte first. Hexadecimal shows the stored bit pattern; storage order shows how those bytes appear in memory from low address to high.

16-bit signed integer

low address → high
low address → high

32-bit signed integer

low address → high
low address → high

64-bit signed integer

low address → high
low address → high

Example: decimal 4,660 is hexadecimal 1234. Big-endian storage order is 12 34; little-endian storage order is 34 12. Decimal −128 is FF 80 big-endian and 80 FF little-endian. Negative values make the byte swap easier to spot. Network byte order is big-endian.