IEEE 754 Floating-Point Converter
Type a decimal to see its 32-bit or 64-bit IEEE 754 bits and the exact value the computer stores, or paste a hex pattern to decode it.
Decimals, 1e-3 style exponents, −0, Infinity and NaN all work.
32-bit pattern (hex)
3DCCCCCD
0.1 can’t be stored exactly; the nearest 32-bit float is 0.100000001490116119384765625.
- sign
- exponent (8)
- fraction (23)
Tap a bit to flip it.
- Kind
- Normal
- Exponent
- 123 − 127 = −4
- Rounding error
- 1.49 × 10-9
Bytes in memory4 bytes, big- and little-endian
The +0, +1 … under each byte is its address offset. Big-endian puts the most significant byte first; little-endian puts it last.
How IEEE 754 stores a number
A float is scientific notation in base 2: a sign, an exponent and a fraction. A 32-bit float has 1 sign bit, 8 exponent bits and 23 fraction bits; a 64-bit double has 1, 11 and 52. The value is (−1)^sign × 1.fraction × 2^(exponent − bias), with a bias of 127 for floats and 1,023 for doubles.
For −6.5: 6.5 is 110.1 in binary, which is 1.101 × 2². The sign bit is 1, the stored exponent is 2 + 127 = 129 (10000001), and the fraction keeps the bits after the point, 101 followed by zeros. The pattern is C0D00000.
Most decimals cannot be written exactly in base 2, the same way ⅓ cannot in base 10, so the nearest float is stored (ties go to the even pattern). 0.1 as a float is really 0.100000001490116…, and the converter shows that exact value and the rounding error. All-zero exponents hold zero and the subnormals, which fill the gap near zero; an all-ones exponent holds infinity and NaN.
value = (−1)ˢ × 1.f × 2^(e − bias); bias 127 (32-bit), 1023 (64-bit)
- IEEE 754 binary32 has a 24-bit significand (23 stored plus a hidden 1), about 7 decimal digits; binary64 has 53 bits, about 15 to 17 digits. Source: IEEE 754-2019, Standard for Floating-Point Arithmetic.
Special and boundary values
Zeros, limits, subnormals, infinity and NaN as 32-bit and 64-bit patterns.
| Value | float32 hex | float64 hex | Note |
|---|---|---|---|
| 0 | 00000000 | 0000000000000000 | zero |
| -0 | 80000000 | 8000000000000000 | negative zero |
| 1 | 3F800000 | 3FF0000000000000 | |
| -2 | C0000000 | C000000000000000 | |
| 0.1 | 3DCCCCCD | 3FB999999999999A | not exact in binary |
| 0.5 | 3F000000 | 3FE0000000000000 | exact: 2⁻¹ |
| 3.14159 | 40490FD0 | 400921F9F01B866E | |
| 16777216 | 4B800000 | 4170000000000000 | 2²⁴: float32 integers exact up to here |
| 16777217 | 4B800000 | 4170000010000000 | rounds to 16777216 in float32 |
| 1.4e-45 | 00000001 | 369FF868BF4D956A | smallest float32 subnormal |
Show all 14 rowsShow fewer
| 1.1754944e-38 | 00800000 | 381000000B3AEEAB | smallest float32 normal |
| 3.4028235e38 | 7F7FFFFF | 47EFFFFFE54DAFF8 | largest float32 |
| Infinity | 7F800000 | 7FF0000000000000 | |
| NaN | 7FC00000 | 7FF8000000000000 | not a number |
Frequently Asked Questions
Why is 0.1 + 0.2 not exactly 0.3?
None of the three is exact in binary. As doubles, 0.1 and 0.2 are each a little above their true values, and their sum rounds to the double just above 0.3, which prints as 0.30000000000000004.
What is a subnormal number?
A value with an all-zero exponent field. It drops the hidden leading 1, trading precision for range, so numbers can fade gradually to zero. The smallest positive float32 is about 1.4 × 10⁻⁴⁵.
Why is there a negative zero?
The sign bit is separate from the value, so 0 and −0 both exist. They compare as equal, but 1 / −0 is −Infinity, which keeps the sign of a result that underflowed.
What is the largest integer a float can hold exactly?
Every integer up to 2²⁴ = 16,777,216 fits in a float32 and up to 2⁵³ = 9,007,199,254,740,992 in a double. Beyond that, some integers are skipped.