Float to Hex Converter
Convert decimal floating-point values to their exact IEEE 754 single-precision 32-bit hexadecimal representation. Inspect the sign bit, exponent, mantissa, binary bit pattern, raw bytes and big-endian or little-endian byte order.
—
—
—
What Is a Float to Hex Converter?
A Float to Hex Converter transforms a decimal floating-point value into the 32-bit hexadecimal bit pattern defined by the IEEE 754 single-precision floating-point standard. The hexadecimal result represents the exact underlying bits stored for the Float32 value rather than a hexadecimal rendering of the decimal text.
This is especially useful for embedded programming, firmware development, binary protocols, PLC and Modbus systems, CAN data, register inspection, network debugging, reverse engineering and low-level software development.
IEEE 754 Single-Precision Float Format
A 32-bit IEEE 754 floating-point number contains one sign bit, eight exponent bits and twenty-three fraction or mantissa bits.
Float32 layout:
1 bit Sign
8 bits Exponent
23 bits Fraction / Mantissa
Total:
32 bits
Hexadecimal representation:
8 hex digitsExample: Convert 1.5 to Hex
The decimal number 1.5 has a simple exact binary representation and is a useful reference value for testing IEEE 754 conversion.
Decimal:
1.5
Binary scientific form:
1.1 × 2^0
Sign:
0
Exponent:
127
= 01111111
Fraction:
10000000000000000000000
Full binary32:
00111111110000000000000000000000
Hex:
0x3FC00000Float to Hex Examples
| Decimal Float | IEEE 754 Hex | Classification |
|---|---|---|
| 0 | 0x00000000 | Positive Zero |
| -0 | 0x80000000 | Negative Zero |
| 1 | 0x3F800000 | Normal |
| 1.5 | 0x3FC00000 | Normal |
| -2.75 | 0xC0300000 | Normal |
| Infinity | 0x7F800000 | Positive Infinity |
| -Infinity | 0xFF800000 | Negative Infinity |
How Float32 Hex Conversion Works
The input value is first converted to IEEE 754 single precision. The resulting 32 bits are then reinterpreted as an unsigned 32-bit integer. That integer can be written directly as eight hexadecimal digits.
Decimal float
↓
Round to Float32
↓
32-bit IEEE 754 pattern
↓
Interpret same bits as uint32
↓
Format as 8 hexadecimal digitsFloat Hex and Endianness
The IEEE 754 bit pattern itself does not change with endianness, but the order in which its four bytes are stored in memory can change. For example, the Float32 value 1.5 has the bit pattern 0x3FC00000.
Float:
1.5
Hex word:
3F C0 00 00
Big-endian bytes:
3F C0 00 00
Little-endian bytes:
00 00 C0 3FThis distinction is important when interpreting memory dumps, PLC registers, Modbus values and binary network or device protocols.
Why 0.1 Changes When Converted to Float32
Many decimal fractions cannot be represented exactly using a finite binary fraction. Decimal 0.1 is one of the most familiar examples. When converted to a 32-bit float, it is rounded to the nearest representable Float32 value.
Input decimal:
0.1
Stored Float32 approximately:
0.10000000149011612
IEEE 754 hex:
0x3DCCCCCDThe calculator displays the actual Float32 value so you can see this rounding effect rather than assuming the decimal input was stored exactly.
IEEE 754 Exponent Bias
For normal Float32 values, the stored exponent uses a bias of 127. This allows both positive and negative binary exponents to be stored as an unsigned eight-bit field.
Actual exponent:
0
Exponent bias:
127
Stored exponent:
0 + 127
= 127
Binary:
01111111Normal, Subnormal, Infinity and NaN Values
The exponent and fraction fields also encode several special categories. Exponent zero is used for zero and subnormal numbers, while exponent 255 is reserved for infinity and NaN values.
| Exponent | Fraction | Meaning |
|---|---|---|
| 0 | 0 | Signed zero |
| 0 | Non-zero | Subnormal |
| 1–254 | Any | Normal finite value |
| 255 | 0 | Infinity |
| 255 | Non-zero | NaN |
Float to Hex Converter Uses
Float-to-hex conversion is useful whenever floating-point values are transferred or inspected as raw binary data. Examples include microcontroller registers, embedded firmware, industrial communication, Modbus floating-point registers, CAN payloads, file formats, packet captures, hexadecimal dumps and debugging binary serialization.
It can also help students understand IEEE 754 by showing how the sign, exponent and fraction fields combine to produce a complete 32-bit floating-point value.