Skip to content

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.

Type

Decimals, 1e-3 style exponents, −0, Infinity and NaN all work.

Precision

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
Big-endiannetwork order3D+0CC+1CC+2CD+3
Little-endianx86 and ARM memoryCD+0CC+1CC+23D+3

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)

Special and boundary values

Zeros, limits, subnormals, infinity and NaN as 32-bit and 64-bit patterns.

Zeros, limits, subnormals, infinity and NaN as 32-bit and 64-bit patterns.
Valuefloat32 hexfloat64 hexNote
0000000000000000000000000zero
-0800000008000000000000000negative zero
13F8000003FF0000000000000
-2C0000000C000000000000000
0.13DCCCCCD3FB999999999999Anot exact in binary
0.53F0000003FE0000000000000exact: 2⁻¹
3.1415940490FD0400921F9F01B866E
167772164B80000041700000000000002²⁴: float32 integers exact up to here
167772174B8000004170000010000000rounds to 16777216 in float32
1.4e-4500000001369FF868BF4D956Asmallest float32 subnormal
Show all 14 rows
1.1754944e-3800800000381000000B3AEEABsmallest float32 normal
3.4028235e387F7FFFFF47EFFFFFE54DAFF8largest float32
Infinity7F8000007FF0000000000000
NaN7FC000007FF8000000000000not 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.