Web4College
Hex to Float · Input, binary and fields
Space plays or pauses. Arrow keys seek 3 seconds. Ctrl plus arrows changes chapter. Shift plus greater or less changes speed. Escape releases focus.
Hex to Float
IEEE 754 · 32-bit floating point
Hex input
4
1
4
8
0
0
0
0
↓
Float output
12.5

Hex to Float Step-by-Step Visualization

Follow 41480000 → 12.5 through the sign, exponent, and fraction.

Spaces and an optional 0x prefix are accepted. Read the most significant byte first.

12.5

Hexadecimal writes binary data compactly: each hex digit represents four bits. Eight hex digits can store one IEEE 754 single-precision float.

Why convert hex to float?

Values from memory, files, or device registers are often written in hex. Reading their sign, exponent, and fraction reveals the floating-point number stored in those bits.

How to convert hex to float

  1. Expand the hex digits. Write four bits for every digit, keeping leading zeros.
  2. Split the 32 bits. Take 1 sign bit, 8 exponent bits, and 23 fraction bits.
  3. Decode the exponent. For a normal value, subtract 127 from the stored exponent.
  4. Build the significand. Read the fractional place values ½, ¼, ⅛, and so on, then add the implicit leading 1.
  5. Combine the fields. Multiply the sign factor, significand, and power of two.

In the Viz, 41480000 gives sign +, exponent 130 − 127 = 3, and significand 1.5625. The result is 1.5625 × 2³ = 12.5.

Zero and subnormal values have an exponent field of 0. Subnormals use exponent −126 without the implicit leading 1. An exponent field of 255 represents infinity or NaN. The calculator handles these patterns too.

Hex to Float Conversion Table

HexFloatMeaning
4148000012.5Worked example in the Viz
3F8000001Positive one
3F0000000.5One half
C0200000−2.5Negative number
000000000Positive zero
80000000−0Negative zero
7F800000+InfinityPositive infinity
7FC00000NaNNot a number

Some decimal fractions are rounded in binary32. For example, 3DCCCCCD stores 0.10000000149011612, close to 0.1.

Key terms

TermMeaning
IEEE 754The floating-point standard used by this 32-bit format.
Sign bit0 means positive; 1 means negative.
ExponentThe 8-bit field that controls the power of two.
BiasThe offset 127 subtracted from the stored exponent for normal values.
FractionThe 23 stored bits after the binary point.
SignificandFor normal values, 1 plus the fraction.