Binary Endianness Converter – Free

Paste a binary value made of whole bytes and this binary endianness converter reverses the byte order, turning big-endian into little-endian or the other way around.

How to use the Binary Endianness Converter tool

  1. Enter the value in the Binary digits box as complete bytes, eight bits each. Spaces between bytes are optional.
  2. Select Convert to reverse the bytes.
  3. Read the bytes in the Result box. They appear in reverse order, separated by spaces.
  4. Select Example to see the built-in single byte, 01001101, which comes back unchanged.
  5. Select Copy to copy the swapped bytes, or Clear to enter a new value.

What endianness means

A value wider than one byte has to be laid out in memory or on a wire in some order. Big-endian puts the most significant byte first. Little-endian puts the least significant byte first. The 32-bit value 0x12345678 is stored as 12 34 56 78 in big-endian and as 78 56 34 12 in little-endian.

x86 and x86-64 processors are little-endian, and ARM and RISC-V systems almost always run that way too. Internet protocols use big-endian, known as network byte order. The names come from Danny Cohen's 1980 note On Holy Wars and a Plea for Peace, which borrowed them from Gulliver's Travels.

How this binary endianness converter swaps bytes

The tool removes whitespace, checks that the input is a whole number of bytes, splits it into 8-bit groups and writes the groups in the opposite order. The bits within a byte keep their positions. Because reversing twice restores the original, the same operation converts in both directions. The tool does not need to know which order you started with. The swap is done in your browser, and nothing is sent to a server.

Worked example: a 32-bit value

Here is 0x12345678 written in binary, most significant byte first. After conversion the byte 01111000 (0x78) leads and 00010010 (0x12) is last. Each byte still reads the same from left to right.

Input:   00010010 00110100 01010110 01111000
Result:  01111000 01010110 00110100 00010010

Mistakes to avoid when swapping byte order

Byte swapping is simple, but a few details regularly cause wrong results in practice.

  • Swap one value at a time. The tool reverses everything you paste as a single unit, so two 16-bit fields pasted together also trade places.
  • Pad to the full width first. The 16-bit value 500 must be entered as 00000001 11110100, not as 111110100.
  • Do not expect a single byte to change. One byte has no byte order, so the page example returns its input.
  • Byte order is not bit order. To reverse the bits themselves, use the Bit reversal Calculator.
  • Text in UTF-8 and other byte streams has no endianness. Only multi-byte numbers and UTF-16 or UTF-32 code units do.

Input limits and error messages

The box accepts up to 65,536 binary digits, which is 8,192 bytes. A 0b prefix is stripped. If the digit count is not a multiple of eight, the tool reports Enter complete bytes, using eight bits per byte. Any character other than 0, 1 or whitespace returns Enter between 1 and 65,536 binary digits. Odd byte counts are allowed: three bytes are reversed just like four.

Frequently asked questions

What is the difference between big-endian and little-endian?

They are opposite byte orders for multi-byte values. Big-endian stores the most significant byte at the lowest address, and little-endian stores the least significant byte there. The value is the same, and only the layout differs.

Does this tool reverse the bits inside each byte?

No. Each 8-bit group is moved as a block. The input 00010010 00110100 becomes 00110100 00010010, and the digits within each group stay in their original sequence.

Why is my single byte unchanged?

Endianness only applies to values of two or more bytes. With one byte there is nothing to reorder, so the output equals the input. Enter 16, 32 or 64 bits to see a swap.

How do I convert little-endian to big-endian?

Paste the bytes as they appear in memory or in the file and select Convert. The reversed result is the big-endian form. The same steps convert big-endian back to little-endian.

What is network byte order?

It is big-endian, the order required for multi-byte fields in IP, TCP and UDP headers. Functions such as htons and htonl convert from the host's order to it. The Binary Network byte order Converter on this site performs the same byte reversal.

Why does my input give a complete bytes error?

The number of binary digits is not divisible by eight. Add leading zeros so that every byte has eight bits. For instance, write 1010 as 00001010.

Related tools