JP / EN
Computers / Data Representation

Big-Endian and Little-Endian — Which Byte Comes First?

The names “big” and “little” do not make the difference obvious. There is one central question: when a multi-byte value is stored, which byte goes at the lowest memory address?

1. Split 0x12345678 into four bytes

The 32-bit hexadecimal value 0x12345678 consists of four bytes:

12 34 56 78

The leftmost byte, 12, is the most significant byte (MSB). The rightmost byte, 78, is the least significant byte (LSB). Endianness changes the order in which these bytes are placed in memory.

Big-endian

Stores the big end, 12, first

12345678
Low addressHigh address →

Little-endian

Stores the little end, 78, first

78563412
Low addressHigh address →
A simple mnemonic
Big-endian: the byte containing the big end goes first.
Little-endian: the byte containing the little end goes first.

2. The same value looks different in memory

AddressBig-endianLittle-endian
0x10000x12 (MSB)0x78 (LSB)
0x10010x340x56
0x10020x560x34
0x10030x78 (LSB)0x12 (MSB)

Both arrangements represent 0x12345678. When a CPU reads data in its native format, arithmetic results are unchanged. Byte order matters when bytes cross a boundary: a network connection, binary file, peripheral interface, or memory dump.

3. Endianness does not reverse the bits

Endianness normally describes the order of whole bytes. It does not reverse the bits inside each byte.

0x12 remains 0x12 in both arrangements.
It does not become the bit-reversed value 0x48.

The written number itself does not change either. The logical value remains 0x12345678; only its byte-level representation in memory or a data stream changes.

4. Floating-point values become byte sequences too

The IEEE 754 single-precision representation of 1.0 has the 32-bit pattern 0x3F800000. The pattern is the same, but its bytes appear differently in memory.

Big-endian 3F 80 00 00 Little-endian 00 00 80 3F

If a sensor value or device register decodes into an implausibly large, tiny, or meaningless number, check the data type and the byte order.

5. Where byte order appears

  • CPU memory:x86 and x64 systems generally use little-endian byte order.
  • Networks:network byte order used by IP protocols is big-endian.
  • Binary files:each file format defines its own byte order.
  • Embedded systems:the CPU, protocol, and peripheral may use different conventions.
  • Memory dumps:you need byte order to reconstruct values from displayed bytes.

Do not rely only on the CPU architecture. Check the specification for the particular data you are reading.

6. Identify the order from known data

A known value makes the order easy to spot. Store the 16-bit value 0x1234 and inspect two bytes from the lower address.

12 34 → Big-endian 34 12 → Little-endian

In a file or protocol specification, look for byte order, endianness, MSB first, or LSB first. “MSB first” can also refer to bit transmission order, so confirm whether the specification is discussing bytes or bits.

7. A practical checklist

  1. How many bytes make up one value?
  2. Does “first” mean the lowest address or the start of a data stream?
  3. Does the MSB or LSB come first?
  4. Is the value an unsigned integer, signed integer, or floating-point number?
  5. Does the converted result fall within a realistic range?

Use M.A.L.'s converter when you want to inspect the relationship between hexadecimal and binary representations.

Open Radix Converter →

8. Remember it in one sentence

Endianness decides whether the most or least significant byte is stored at the lower address.