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.
Examples
Input
Output
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
- Expand the hex digits. Write four bits per digit. Keep leading zeros.
- Split the 32 bits. Take 1 sign bit, 8 exponent bits, and 23 fraction bits.
- Decode the exponent. Read the exponent bits as E. For E from 1 to 254, subtract 127.
- Build the significand. For a normal value, add the place values of the fraction’s 1 bits (½, ¼, ⅛, …), then add the leading 1.
- 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
| Hex | Float | Meaning |
|---|---|---|
41480000 | 12.5 | Default example |
3F800000 | 1 | Positive one |
3F000000 | 0.5 | One half |
C0200000 | −2.5 | Negative number |
00000000 | 0 | Positive zero |
80000000 | −0 | Negative zero |
7F800000 | +Infinity | Positive infinity |
7FC00000 | NaN | Not a number |
Key terms
| Term | Meaning |
|---|---|
| IEEE 754 | The standard that defines this floating-point format. |
| Sign bit | 0 means positive; 1 means negative. |
| Exponent | Eight bits that determine the scale or mark a special value. |
| Bias | 127, the offset for normal exponents. |
| Fraction | 23 bits that encode the fractional part. |
| Significand | 1 plus the fraction for normal numbers; just the fraction when E = 0. |
Format reference: Oracle’s IEEE 754 single-format guide.