Guide
Endianness: reading multi-byte numbers in the right order
A byte holds 0 to 255 whatever machine you use, but a number that needs several bytes must be laid out in some order, and there are two sensible choices. Big-endian puts the most significant byte first, the way we write decimal numbers. Little-endian puts the least significant byte first. Neither is more correct, and both are in daily use, so data that crosses from one world to the other often needs its bytes turned round.
The two orders
Take the 32-bit number 0x12345678. A big-endian machine stores the bytes at increasing addresses as 12 34 56 78. A little-endian machine stores 78 56 34 12. The same four bytes mean different numbers depending on the order in which you read them: 305,419,896 in one case and 2,018,915,346 in the other. The converter prints both readings, so a value that looks absurd in one order can be checked against the other.
Who uses which
Internet protocols use big-endian and call it network byte order, so port numbers and addresses in packet headers are in that order. File formats such as PNG and Java class files are also big-endian. The x86 and x86-64 processors are little-endian, and so are most ARM systems in their usual configuration, which means that programs on those machines must convert before sending numbers over a network or writing them to a big-endian format. Some formats, such as TIFF, announce their order in the header.
Using the page
Type the bytes as hexadecimal, with or without spaces and a 0x prefix, and choose a width: 16, 32 or 64 bits, or “any number of bytes”. The page shows the original bytes, the reversed bytes, the reversed bytes as one hex number, and the decimal reading in each order. Below that a table lists the offsets +0, +1, +2 and so on with the byte stored there for big-endian and little-endian layouts.
Edge cases
If you enter an odd number of hex digits, a zero is added at the front so that the bytes are whole. When a fixed width is chosen, the value must have exactly that many bytes, and the page reports the mismatch otherwise, so write any leading zero bytes yourself. Swapping a value twice returns the original. A single byte is its own reverse. The tool swaps the whole value; structures with several fields of different sizes must be swapped field by field, since reversing the entire block would also reverse the order of the fields.
A worked example
The Sample button loads 12 34 56 78. The reversed bytes are 78 56 34 12, which is 0x78563412 when written as one number. Read as big-endian the original is 305,419,896, and read as little-endian it is 2,018,915,346. In the memory table, a big-endian machine would hold 12 at offset +0 and 78 at offset +3, and a little-endian machine would hold 78 at +0 and 12 at +3. If your code printed 0x78563412 where you expected 0x12345678, you have found a missing conversion.
Limits
The page cannot tell which order your data is in; you have to know the specification of the format or the machine. It treats the input as unsigned bytes and does not interpret floating-point numbers, so for a float or double use the IEEE 754 converter after correcting the order. It only reverses whole bytes and never reorders bits.
Related tools
- Hex to Binary lets you look at the bits of each byte.
- Hex to Decimal gives the numeric value of any hex number.
- IEEE 754 Converter decodes floats once the byte order is right.
- Bitmask Calculator works on individual bits inside a value.
Checked against the current version of the Endian Converter on .

