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

IEEE 754 float converter

Free IEEE 754 float converter: float32 and float64 between hex and decimal, with the sign, exponent and mantissa fields and the value actually stored.

This IEEE 754 float converter splits a float into sign, exponent and mantissa: 20.5 is 41A40000 as a float32, and 0.1 is stored as 0.100000001490116, because it has no exact binary form.

Also Infinity, -Infinity and NaN.

Big-endian, 8 or 16 hex digits. Swap the bytes yourself for little-endian devices.

Hex (big-endian)
–
Value stored
–
Difference from what you typed
–
Sign · exponent · mantissa (bits)
–
Sign
–
Exponent field
–
Mantissa field
–
Kind

How it works

How is a number stored as an IEEE 754 float?

A float32 has 1 sign bit, 8 exponent bits (bias 127) and 23 mantissa bits; a float64 has 1, 11 (bias 1023) and 52. A normal value is (−1)sign × 1.mantissa × 2exponent − bias.

Most decimals cannot be stored exactly: 0.1 as a float32 is 0.100000001490116. The difference row shows how far the stored value is from what you typed.

An exponent of all zeros means zero or a subnormal value; all ones means infinity (mantissa zero) or NaN.

Glossary Modbus register

Questions

Questions about the IEEE 754 float converter

Why is 0.1 stored as 0.100000001?

Binary fractions can only add up halves, quarters, eighths and so on; 0.1 has no exact binary form, so the nearest float32 is stored instead.

My device sends floats in two Modbus registers. Which order?

Try the byte orders in the Modbus register decoder: ABCD is big-endian; CDAB, BADC and DCBA are the common swaps.