Skip to main content
Byte Array Tools

Endianness Converter

Swap byte order between big-endian and little-endian for 16, 32 and 64-bit values, and see the numbers each order represents.

Enter a hex number or a run of bytes to reverse the byte order of each 16, 32 or 64-bit word.

A single hex number (0x12345678) or a run of bytes (78 56 34 12 EF BE AD DE). Bytes are swapped within each word.

Network protocols use big-endian, while x86 and most ARM systems store numbers little-endian - mismatches are a classic source of wrong values.

What Is the Endianness Converter?

Endianness is the order in which a multi-byte number is stored. Big-endian puts the most significant byte first (12 34 56 78), which is how numbers are written and how network protocols send them. Little-endian puts it last (78 56 34 12), which is how x86 and most ARM processors store them in memory. This tool swaps the byte order of 16, 32 or 64-bit values.

When to Use It

  • A value read from a file or a packet looks wildly wrong - often a sign the bytes were read in the wrong order.
  • Converting between network byte order and host order by hand, as htonl() and ntohl() do in code.
  • Reading multi-byte fields in a hex dump.

How to Use It

  1. Enter a single hex number such as 0x12345678 or a run of bytes.
  2. Choose the word size: 16, 32 or 64 bits.
  3. Read the swapped bytes and the unsigned value of each word in both orders.

Example

The bytes 78 56 34 12 EF BE AD DE with 32-bit words are two words. Swapped, they become 12 34 56 78 (305419896) and DE AD BE EF (3735928559) - the values a little-endian machine meant when it wrote them.

Understanding the Output

Bytes are reversed within each word, never across words. A single hex number shorter than the word size is padded with zeros on the left first, so 0x1234 as a 32-bit word is 00 00 12 34.

Limitations

The input must be a whole number of words. Bits inside a byte are never reversed - endianness is about byte order only. To see signed integers and floating-point values for the same bytes, use Bytes to Integer / Float.

Frequently Asked Questions

Big-endian stores the most significant byte first, so 0x12345678 is stored as 12 34 56 78. Little-endian stores it last: 78 56 34 12. Network protocols use big-endian; x86 and most ARM processors use little-endian.

Almost certainly. Intel and AMD x86 processors, Apple silicon and nearly all Android and iOS devices run little-endian. Big-endian is now mostly found in network protocols, some file formats and older or specialised hardware.

No. Endianness only changes the order of whole bytes within a multi-byte value. The bits inside each byte stay the same.

Network byte order is big-endian. Functions such as htons, htonl, ntohs and ntohl convert values between the host order of your machine and network order before sending or after receiving data.
Share this tool: