Modbus Byte Order Converter

ABCD Modbus Byte Order

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.

ABCD BADC CDAB DCBA 2 Registers
32-Bit Byte Order Converter 4 Bytes
Enter exactly 8 hexadecimal digits. Optional 0x prefix is accepted.
The letters A, B, C and D represent the four logical bytes of one 32-bit value. This calculator changes their order only; it does not decode the bytes as a Float32 or integer.
Converted Byte Order
Input Hex
Input Order
Output Hex
Output Order
Register 1 Hex
Register 2 Hex
Register 1 Decimal
Register 2 Decimal
Byte 1
Byte 2
Byte 3
Byte 4
32-Bit Binary After Conversion

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:

A = 12
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:

12345678

Converting from ABCD to CDAB moves the second 16-bit word before the first:

ABCD: 12 34 56 78

CDAB: 56 78 12 34

Converted hex: 56781234

Word Swap vs Byte Swap

Different order changes affect different parts of the four-byte sequence.

ABCD → CDAB
Word swap
12 34 56 78 → 56 78 12 34
ABCD → BADC
Byte swap inside each word
12 34 56 78 → 34 12 78 56
ABCD → DCBA
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.

Converted value: 56781234

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

Important: this calculator reorders exactly four bytes.

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.

Modbus Byte Order Converter FAQs

What does ABCD byte order mean?
ABCD means the four logical bytes appear in their original order: A, B, C and D.
What does CDAB mean?
CDAB places the second 16-bit word before the first, producing byte order C, D, A, B.
What does BADC mean?
BADC swaps the two bytes within each 16-bit word, producing B, A, D, C.
What does DCBA mean?
DCBA reverses all four bytes.
Can this tool perform a Modbus word swap?
Yes. Converting ABCD to CDAB performs the common two-word swap for a 32-bit value.
Does this calculator decode a Float32?
No. It only rearranges the four bytes. Floating-point interpretation is a separate operation.
Does it convert UINT32 values?
No. The calculator treats the input as an eight-digit hexadecimal byte pattern and only changes byte order.
Why are there different Modbus byte orders?
Modbus defines 16-bit registers but does not impose one universal arrangement for all multi-register application values, so device implementations can differ.
Scroll to Top