Modbus Byte Order Converter
Reorder the four bytes of a 32-bit Modbus value between ABCD, BADC, CDAB and DCBA layouts. View the converted hexadecimal value, individual bytes, binary pattern and resulting 16-bit register words.
What Is Modbus Byte Order?
A 32-bit value contains four bytes, but Modbus transports data in 16-bit registers. Device manufacturers may arrange the two words and the bytes inside those words in different orders when storing a 32-bit application value.
Byte-order notation such as ABCD, BADC, CDAB and DCBA provides a compact way to describe where the four logical bytes appear in the transmitted or stored sequence.
ABCD, BADC, CDAB and DCBA
Assume the logical 32-bit value consists of four bytes:
B = 34
C = 56
D = 78
| Order | Byte Sequence | Example |
|---|---|---|
| ABCD | A B C D | 12 34 56 78 |
| BADC | B A D C | 34 12 78 56 |
| CDAB | C D A B | 56 78 12 34 |
| DCBA | D C B A | 78 56 34 12 |
Modbus Byte Order Conversion Example
Suppose the logical value in ABCD order is:
Converting from ABCD to CDAB moves the second 16-bit word before the first:
CDAB: 56 78 12 34
Converted hex: 56781234
Word Swap vs Byte Swap
Different order changes affect different parts of the four-byte sequence.
Word swap
12 34 56 78 → 56 78 12 34
Byte swap inside each word
12 34 56 78 → 34 12 78 56
Full byte reversal
12 34 56 78 → 78 56 34 12
Two 16-Bit Registers After Conversion
After the four bytes are reordered, the first two bytes form register 1 and the final two bytes form register 2.
Register 1: 5678
Register 2: 1234
The calculator displays both hexadecimal and unsigned decimal register values for the converted layout.
Why Modbus Byte Order Matters
Using the wrong byte order can completely change the apparent value when software later interprets the 32 bits as an integer, floating-point number or other application data type.
For example, two systems may contain exactly the same four logical bytes but arrange them differently across Modbus registers. Reordering those bytes correctly is therefore an essential troubleshooting step before interpreting the data.
Modbus Does Not Define 32-Bit Application Byte Order
Modbus registers are 16 bits wide. When an application stores values larger than one register, the interpretation and ordering of those multiple registers is generally defined by the equipment manufacturer or software implementation.
For that reason, users should always compare the required arrangement with the device register map before converting or decoding the value.
Important Modbus Byte Order Notes
Input must represent one 32-bit value using eight hexadecimal digits.
ABCD means A B C D.
BADC means B A D C.
CDAB means C D A B.
DCBA means D C B A.
The calculator changes byte position only.
It does not interpret the value as Float32, UINT32 or INT32.
Always confirm the required order in the manufacturer’s Modbus documentation.