FormatterHQ

Reverse Hex (Endianness Swap)

Reverse the byte order of hex strings to convert between big-endian and little-endian, or flip every hex digit. Each line is processed separately.

Loading tool…
Ready.

How to use the Reverse Hex (Endianness Swap)

  1. Paste one hex value per line; 0x prefixes, spaces and colons between bytes are removed automatically.
  2. Choose whether to reverse the byte order or every single hex digit.
  3. Copy the reversed values from the output.

Reverse hex byte order online

This reverse hex tool swaps the byte order of hexadecimal strings, turning a big-endian value into little-endian and back again. It also offers a second mode that reverses every hex digit, for the rarer cases where you need the string mirrored nibble by nibble.

What is endianness?

A multi-byte number has to be stored in memory one byte at a time, and systems disagree on the order. Big-endian puts the most significant byte first; little-endian puts the least significant byte first. The 32-bit value 0x12345678 looks like this in each:

Big-endian:     12 34 56 78
Little-endian:  78 56 34 12

x86 processors and most ARM systems run little-endian. Network protocols such as IP and TCP send multi-byte fields in big-endian, often called network byte order. Moving data between the two means reversing bytes.

The two modes

InputByte orderEvery hex digit
123456787856341287654321
0xDEADBEEFEFBEADDEFEEBDAED
A1B2C3C3B2A13C2B1A

Byte order keeps each pair of digits together and reverses the pairs; this is the endianness swap. Digit mode reverses the string one character at a time, which also swaps the two halves of every byte.

How input is cleaned

  • A leading 0x is removed, and so are spaces and colons, so de ad be ef and 12:34:56:78 are accepted. The output has no prefix or separators.
  • Letter case is kept as typed: lowercase in, lowercase out.
  • In byte mode, an odd number of digits is padded with a leading zero, so ABC is treated as 0ABC and becomes BC0A.
  • Each line is reversed on its own. Anything other than hex digits produces an error naming the line.

Practical examples

A hex dump of a little-endian file shows the bytes 78 56 34 12 for a 32-bit field. Reversing gives 12345678, and the hex to decimal converter then shows its value, 305419896.

Bitcoin is another common case: block hashes and transaction IDs are usually displayed with their bytes in the reverse of the order used internally, so comparing raw data with an explorer needs a byte swap.

Mind the field width

Byte mode reverses the whole line. If a dump contains several 32-bit values back to back, put each 8-digit value on its own line; reversing the entire run at once would also swap the order of the fields. Swapping twice always returns the original string. To inspect the bits of the result, use hex to binary, and to read hex bytes as characters, use hex to string.

Frequently asked questions

How do I convert little-endian hex to big-endian?
Reverse the order of the bytes (pairs of hex digits) while keeping each pair intact. 78563412 becomes 12345678. The same operation also converts big-endian to little-endian.
What is the difference between byte mode and digit mode?
Byte mode reverses two-digit pairs, which is what an endianness swap means. Digit mode reverses every single hex character, so 12345678 becomes 87654321 instead of 78563412.
What happens with an odd number of hex digits?
In byte mode a zero is added at the front to complete the first byte. ABC is treated as 0ABC and becomes BC0A.
Does reversing change the value?
The bytes are the same, but the number they represent changes when read in a fixed order. 0x12345678 is 305419896, while 0x78563412 is 2018915346, which is why reading data with the wrong endianness gives wildly wrong numbers.

Last updated September 26, 2026

Related tools