ToolLineup

Reverse Hex (Endianness Swapper)

This tool reverses the byte order of a hexadecimal value, converting between big endian and little endian representations. It swaps whole byte pairs rather than individual characters, because byte order is a property of bytes — reversing the characters instead would produce a value that is simply wrong. This is what you need when a number read out of a file, a packet capture, a memory dump or a hardware register comes out looking absurd. A value that should be 26 but reads as 436,207,616 is almost always the same bytes in the opposite order, and swapping them turns the nonsense back into the number you expected.

How it works

Swaps the byte order of a hexadecimal value — big endian to little endian and back. Bytes are reversed as whole pairs, not as individual characters, because byte order is about bytes.

This is what you need when a value read from a file, a packet capture or a memory dump comes out looking wrong by orders of magnitude. Reversing the bytes usually turns nonsense back into the number you expected.

Everything runs in your browser — nothing you enter is sent to a server.

The same number, two ways

The 32-bit value 26 is stored as 0000001A big endian and 1A000000 little endian. Read the second as if it were the first and you get 436,207,616 — which is why a byte order mistake produces numbers that are not slightly wrong but absurd.

Where each convention is used

  • Little endian — x86, x86-64 and ARM in its usual configuration. Most files written by a desktop program.
  • Big endian — network protocols (hence "network byte order"), and formats such as PNG, JPEG and Java class files.

Neither is better. Little endian makes truncating to a smaller type trivial; big endian matches how humans write numbers. The trouble only starts when data crosses between them.

Spotting the problem

A timestamp far in the future or the distant past, a length field larger than the file, or a small counter reading in the hundreds of millions — all are byte order problems. Swap and see whether the value becomes sensible.

Frequently asked questions

What is endianness?

The order in which a multi-byte number is stored. Big endian puts the most significant byte first, little endian puts it last. Both are correct — they are just different conventions.

When do I need to swap bytes?

When a value read from a file, a network capture, a memory dump or a hardware register comes out wildly wrong. A number that should be small but reads in the millions is the classic sign.

Why swap bytes rather than characters?

Because a byte is two hex characters and byte order is about bytes. Reversing individual characters would turn 1A into A1 and produce a completely different value.

What happens with an odd number of digits?

A leading zero is added, since byte order only makes sense on whole bytes. The tool tells you when it has done this.

Which systems use which order?

x86 and ARM are little endian in practice; network protocols and many file formats are big endian, which is why it is called network byte order.

Is my data uploaded?

No. The swap is arithmetic and runs entirely in your browser.

Related tools