Skip to content

Modbus Float Converter

Modbus registers are 16 bits wide, so a 32-bit value (IEEE-754 float, Int32 or Uint32) is spread over two registers. The standard does not define which register or byte comes first, so devices differ. This tool decodes two registers into Float32, Int32 and Uint32 under any of the four common orders, shows the IEEE-754 bit breakdown, and encodes a value back into registers.

Byte / Word Order

ABCD is the canonical big-endian 32-bit value. Register 1 is the first register read. Selected: R1 = AB, R2 = CD.

Register format
Presets

Take the 32-bit value 230.5 = 0x43668000, whose bytes are A=43 B=66 C=80 D=00. Here is how each order lays it out across the two registers.

Order Also called Byte layout Register 1 Register 2
ABCD Big-endian A B / C D 0x4366 0x8000
CDAB Word swap, little-endian word swap C D / A B 0x8000 0x4366
BADC Byte swap, big-endian byte swap B A / D C 0x6643 0x0080
DCBA Little-endian D C / B A 0x0080 0x6643

Other reference values: -40.25 = 0xC2210000 and 50.0 = 0x42480000.

Manuals often list “40001” or “register 1” for what is address 0 on the wire. If your read is off by one register, the result is two shifted words and a nonsense float. Check whether your tool or library expects the protocol (0-based) address or the documented (1-based) one.

Many devices skip floats and send scaled integers instead, for example 2305 meaning 230.5 V with a factor of 0.1. Decode the integer first, then apply the scale from the manual. Use the Int32 or Uint32 results above for 32-bit scaled values.