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.

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