New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Modbus register decoder

Free Modbus register decoder: turn hex registers into uint16, int16, uint32, int32 and float32 values in all four byte orders, ABCD, CDAB, BADC and DCBA.

This Modbus register decoder joins two 16-bit registers into one 32-bit value in each byte order. 41A4 0000 read as ABCD is the float 20.5; the row that gives a sensible number is the order your device uses.

One to eight 16-bit registers in hexadecimal, separated by spaces, for example 41A4 0000. A 0x prefix is fine.

Each register (16 bits)

RegisterHexUnsigned (uint16)Signed (int16)

Registers 1 and 2 as one 32-bit value

Byte orderuint32int32float32
ABCDBig-endian: high word first–––
CDABWord swap: low word first–––
BADCByte swap in each word–––
DCBALittle-endian: both swapped–––

How it works

How do you decode a float from two Modbus registers?

A Modbus register holds 16 bits. A 32-bit value, such as a float or a long counter, spans two registers. Call the bytes of the first register A and B and those of the second C and D.

Devices disagree on the order: ABCD is the standard big-endian order, CDAB swaps the two words, BADC swaps the bytes inside each word, and DCBA reverses all four. The row that gives a sensible value is the order your device uses.

float32 is the IEEE 754 single-precision format. 41A4 0000 in ABCD is 20.5.

In Hermetry Gateways read Modbus devices for you and bring each one into Hermetry as its own device: Devices behind a gateway.

Glossary Modbus register, Modbus RTU, Modbus TCP

Questions

Questions about the Modbus register decoder

Why does my float look wrong?

Almost always the byte order. Try the four rows: the one that gives a sensible number, such as 20.5 instead of 4.7 × 10⁻⁴¹, is the order your device uses.

How many registers does a 32-bit value take?

Two. A 64-bit value (a double or a long energy counter) takes four.