Enter a hex value, a list of bytes or a decimal number and see it with its bytes reversed, read as big-endian and little-endian integers and floats, plus every 16-bit word-swap order used by Modbus devices.
Last updated:
Enter your values to see the result.
Advertisement
Advertisement
How to use the Endianness Converter
Choose the input type: hex, unsigned decimal or signed decimal.
Pick a width or leave it on Auto.
Type the value. For raw bytes from a dump or packet, separate them with spaces.
Click Convert (results also update as you type).
Read the swapped value and look up the right order in the byte-order table.
Byte orders at a glance (0x12345678)
Order
Name
Bytes in memory
Where you see it
ABCD
Big-endian
12 34 56 78
Network protocols, Java class files, many file formats, Motorola 68k, Modbus default
DCBA
Little-endian
78 56 34 12
x86/x64 PCs, most ARM devices, Windows and Linux memory dumps
CDAB
Word-swapped
56 78 12 34
Some PLCs and Modbus devices for 32-bit values
BADC
Byte-swapped words
34 12 78 56
Some Modbus devices and old mid-endian systems
Byte swap in code
Language
32-bit swap
C / C++ (GCC, Clang)
__builtin_bswap32(x), or htonl/ntohl for host ↔ network order
C++23
std::byteswap(x)
Python
int.from_bytes(x.to_bytes(4, 'big'), 'little'), or struct.unpack('<I', data)
JavaScript
new DataView(buf).getUint32(0, true) reads little-endian
Swap bytes, not hex digits: reversing "12345678" character by character gives 87654321, which is wrong.
If a sensor reading looks absurd (huge or tiny), the byte order is the usual suspect. Compare the float column for each order with the value you expect.
For float bit layouts (sign, exponent, mantissa) use the IEEE 754 Converter.
Frequently asked questions
What is endianness?
Endianness is the order in which the bytes of a multi-byte number are stored. Big-endian stores the most significant byte first (at the lowest address); little-endian stores the least significant byte first. 0x12345678 is stored as 12 34 56 78 in big-endian and 78 56 34 12 in little-endian.
Which systems are little-endian?
x86 and x86-64 processors, and ARM and RISC-V as they are normally configured, are little-endian. Network protocols such as TCP/IP use big-endian, which is why it is called network byte order.
How do I convert big-endian to little-endian?
Reverse the order of the bytes, not the individual hex digits. 0x12345678 becomes 0x78563412. The same operation converts in both directions.
What are CDAB and BADC byte orders?
They are mixed orders seen when 32-bit values are split across two 16-bit registers, as in Modbus. CDAB swaps the two 16-bit words (0x12345678 → 0x56781234) and BADC swaps the bytes inside each word (→ 0x34127856). If a float from a device looks wrong, try each order.
Does endianness affect single bytes or text?
No. A single byte has no byte order, and UTF-8 text is a sequence of single bytes. Endianness matters for multi-byte numbers and for UTF-16/UTF-32 text, which is what a byte order mark (BOM) indicates.
How does a negative number look when swapped?
Negative integers are stored in two's complement. −2 as a 32-bit value is 0xFFFFFFFE; with the bytes swapped it reads 0xFEFFFFFF, which is −16,777,217 as a signed integer.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.