All calculators

IEEE 754 Float & Modbus Register Converter

Decode IEEE-754 float32 bytes or encode a REAL value. Compare four byte orders, two register values and the underlying bits.

Enter your values

Try an example

Your result

Decimal REAL value1
Four hex bytes
3F 80 00 00
First register (decimal)
16256
Second register (decimal)
0
Canonical IEEE bytes
3F 80 00 00
IEEE-754 class
Normal

Calculated

The decimal output is the stored float32 value, including rounding.

Four bytes → two registers → one REAL value
IEEE 754 Float & Modbus Register ConverterWIRE BYTE ORDERR03FR080R100R10000111111100000000000000000000000SIGNEXPONENTFRACTION

How this answer is calculated

These steps use your current values. Change an input to follow a different calculation.

  1. 1

    Put the bytes in canonical order

    3F 80 00 00 [ABCD] → 3F 80 00 00 [ABCD]
  2. 2

    Separate sign, exponent and fraction

    0 | 01111111 | 00000000000000000000000
  3. 3

    Interpret the stored float32

    (−1)^0 × (1 + 0/2^23) × 2^(127 − 127) = 1

How to use this on a job

Two good register reads can still produce a nonsense temperature. Modbus tells you how bytes travel inside a register; your device manual tells you how the two registers form a 32-bit value. Those are separate decisions.

  1. 01

    Choose encode to turn a decimal REAL into four bytes, or decode to inspect four captured hexadecimal bytes. For two decimal register values, first convert each to four hex digits using the integer tool.

  2. 02

    Choose the byte order stated by the device. A, B, C and D name the bytes from most to least significant in the canonical IEEE-754 representation. ABCD preserves them; CDAB swaps the words; BADC swaps bytes within each word; DCBA reverses all four.

  3. 03

    Read the sign, biased exponent and fraction. The decimal result is the actual stored float32, so 0.1 does not come back as exactly 0.1. Compare a known process value before accepting an order.

Work through one example

3F 80 00 00 → 1.0

REAL 1.0 has canonical bytes 3F 80 00 00. In ABCD order the registers are 16256 and 0. In CDAB order they are 0 and 16256. The information has not changed; its placement has. Try 0.1 to see float32 rounding directly.

Before you trust the answer

A plausible value is not proof of correct byte order. Check the register map, data type and a second known operating point. Special patterns such as NaN are decoded explicitly; this tool does not replace them with zero.

The same REAL 1.0 in four byte orders

OrderBytes on the wireDecimal registers
ABCD3F 80 00 0016256, 0
BADC80 3F 00 0032831, 0
CDAB00 00 3F 800, 16256
DCBA00 00 80 3F0, 32831

Questions that come up on the job

My register reads are correct. Why is the value wrong?

Check the map’s data type first. Two registers could hold an integer, a scaled measurement or a REAL. For a REAL, check the word order as well as the byte order. A valid CRC confirms the received bytes, not their interpretation.

Why does 0.1 return a longer decimal?

Float32 has a finite binary fraction. Just as one third cannot be written with a finite number of decimal digits, 0.1 cannot be stored exactly in this format. The decoder shows the stored value instead of hiding the rounding.

TRYPLC FIELD REFERENCE / 01

IEEE 754 Float & Modbus Register Converter

Decode IEEE-754 float32 bytes or encode a REAL value. Compare four byte orders, two register values and the underlying bits.

  • Float32: 1 sign + 8 exponent + 23 fraction bits
  • Normal: (−1)ˢ × (1 + f/2²³) × 2ᵉ⁻¹²⁷
  • Exponent 0: zero or subnormal
  • Exponent 255: infinity or NaN
IEEE 754 Float & Modbus Register ConverterWIRE BYTE ORDERR03FR080R100R10000111111100000000000000000000000SIGNEXPONENTFRACTION

How to use this on a job

Two good register reads can still produce a nonsense temperature. Modbus tells you how bytes travel inside a register; your device manual tells you how the two registers form a 32-bit value. Those are separate decisions.

  1. 01

    Choose encode to turn a decimal REAL into four bytes, or decode to inspect four captured hexadecimal bytes. For two decimal register values, first convert each to four hex digits using the integer tool.

  2. 02

    Choose the byte order stated by the device. A, B, C and D name the bytes from most to least significant in the canonical IEEE-754 representation. ABCD preserves them; CDAB swaps the words; BADC swaps bytes within each word; DCBA reverses all four.

  3. 03

    Read the sign, biased exponent and fraction. The decimal result is the actual stored float32, so 0.1 does not come back as exactly 0.1. Compare a known process value before accepting an order.

Work through one example

3F 80 00 00 → 1.0

REAL 1.0 has canonical bytes 3F 80 00 00. In ABCD order the registers are 16256 and 0. In CDAB order they are 0 and 16256. The information has not changed; its placement has. Try 0.1 to see float32 rounding directly.

Before you trust the answer

A plausible value is not proof of correct byte order. Check the register map, data type and a second known operating point. Special patterns such as NaN are decoded explicitly; this tool does not replace them with zero.

https://tryplc.com/tools/float-register-decoder