Sync Motion Logo
All tools

Modbus float and IEEE 754 converter

Convert floats to hex and Modbus registers and back, in ABCD, BADC, CDAB and DCBA order

Calculator

Enter a decimal without thousands separators, or use scientific notation. NaN, Infinity and −Infinity are also accepted
A is the most significant byte of the IEEE 754 bit pattern. Modbus does not define float32 order, so follow the device manual

Float32 value: 123456

Conversion

Float32 value

123456

Normal

Modbus registers

0x47F1 · 0x2000

Unsigned decimal: 18417 · 8192 · Signed INT16: 18417 · 8192

Hex in selected order

0x47F12000

Transmitted bytes: 47 F1 20 00

IEEE 754 hex

0x47F12000

A B C D: 47 F1 20 00

Details

Sign / exponent / mantissa

0 / 143 / 0x712000

sign: 0 · stored exponent: 143 · mantissa: 7413760

Integer views with 32 bits

1206984704 / 1206984704

UINT32 / INT32

All byte orders

The same float32 value in every supported Modbus byte order
OrderHex / Transmitted bytesRegister 1Register 2
ABCD (selected)0x47F120000x47F10x2000
BADC0xF14700200xF1470x0020
CDAB0x200047F10x20000x47F1
DCBA0x0020F1470x00200xF147

Formulas

An IEEE 754 float32 occupies two consecutive Modbus registers with 16 bits each. Byte and word order depend on the device

A B C D = IEEE 754 bytes from most to least significant

ABCD: registers AB / CD · BADC: BA / DC

CDAB: registers CD / AB · DCBA: DC / BA

Assumptions and limitations

  • A to D name the IEEE 754 bytes from most to least significant, regardless of the browser's memory order
  • Enter decimals from 0 to 65535, signed INT16 values from −32768 to −1, or hex with 0x
  • NaN, ±Infinity, −0 and subnormal values are valid IEEE 754 states and are identified in the result
  • Modbus sends each register's high byte first. Follow the device manual for float32 order and check it with a known value

Sources

The formulas and conventions were checked against the following sources: