Web4College
Loading visualization…

Hex to Float Converter — Step-by-Step Visualization

Convert an 8-digit hex value to a 32-bit IEEE 754 float, then explore the conversion step by step.

12.5

Interpret eight hex digits as one 32-bit IEEE 754 float. Use this to read bit patterns from files, memory, or device registers.

How to convert hex to float

  1. Expand the hex digits. Write four bits per digit. Keep leading zeros.
  2. Split the 32 bits. Take 1 sign bit, 8 exponent bits, and 23 fraction bits.
  3. Decode the exponent. Read the exponent bits as E. For E from 1 to 254, subtract 127.
  4. Build the significand. For a normal value, add the place values of the fraction’s 1 bits (½, ¼, ⅛, …), then add the leading 1.
  5. Combine the fields. Multiply the sign factor (+1 or −1), significand, and power-of-two factor.

Example: 41480000 gives sign +, exponent 130 − 127 = 3, and significand 1.5625. So +1 × 1.5625 × 2³ = 12.5.

E = 0 uses exponent −126 and a leading 0; a zero fraction gives signed zero. E = 255 means infinity when the fraction is zero, or NaN otherwise.

Hex to float examples

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

Key terms

TermMeaning
IEEE 754The standard that defines this floating-point format.
Sign bit0 means positive; 1 means negative.
ExponentEight bits that determine the scale or mark a special value.
Bias127, the offset for normal exponents.
Fraction23 bits that encode the fractional part.
Significand1 plus the fraction for normal numbers; just the fraction when E = 0.

Format reference: Oracle’s IEEE 754 single-format guide.