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
32-bit signed integer
64-bit signed integer
How big-endian and little-endian storage work
Multi-byte integers in memory
When an integer needs more than one byte, machines must choose an order. Big-endian stores the most significant byte at the lowest address (the way we write hex left-to-right). Little-endian stores the least significant byte first — the dominant layout on x86/x64 PCs. This page shows signed two’s-complement values and how their bytes appear from low address to high in each order.
Worked example
The 32-bit value 0x12345678 appears as bytes 12 34 56 78 in big-endian memory order, but 78 56 34 12 in little-endian order. Misreading a dump with the wrong endianness scrambles addresses, colours, and lengths in file formats.
Where it matters
- Network protocols historically prefer big-endian “network order.”
- PC memory dumps and many game assets are little-endian.
- File format specs always state endianness for multi-byte fields.
Common mistakes
- Casting byte arrays to integers in C without matching the host endianness.
- Confusing bit order inside a byte with byte order among bytes.
- Forgetting two’s complement when the high bit is set on signed values.
FAQs
- Does UTF-8 text have endianness?
- UTF-8 is a byte stream; endianness mainly appears with UTF-16/32 and raw integers.
- How do floats appear?
- IEEE layouts still occupy multiple bytes — see IEEE 754 and then apply endianness when viewing memory.
Related: IEEE 754, Signed & Unsigned, Bits & Bytes.
Last updated: July 2026