IEEE 754 Float Visualizer
Convert a decimal number to its IEEE 754 bits and see the sign, exponent and mantissa broken out.
Exact decimal value stored
0.100000001490116119384765625
Rounding error +1.490116e-9 (relative 1.49e-8)
Single precision (32-bit) ยท Normal number ยท 0x3DCCCCCD
Click any bit to flip it - the decimal value updates straight away.
Bit-level breakdown
- Class
- —
- Sign bit
- —
- Exponent field
- —
- Unbiased exponent
- —
- Mantissa field
- —
- Hexadecimal
- —
- Value as stored
- —
- Shortest round-trip
- —
- Gap to the next value (1 ULP)
- —
How it works
Type a decimal number and this visualizer shows exactly how it is stored in memory as an
IEEE 754 floating-point number: the sign bit, the biased exponent field and the mantissa
(significand) field, in binary and hex, for binary16 (half), binary32 (single) and
binary64 (double). Click any bit to flip it and the decimal value it now represents is
recalculated instantly. It works the other way too - paste a hex pattern such as
3F800000 or a raw binary string and you get the number back.
The encoder follows IEEE 754-2019 for the binary16, binary32 and binary64 interchange
formats, including round-to-nearest ties-to-even, gradual underflow to subnormals, signed
zeros, infinities and NaN. Rounding is done in exact integer arithmetic with BigInt, so
1.0 gives 0x3F800000, 0.1 gives
0x3DCCCCCD and the panel shows the exact decimal value that pattern really
holds - 0.100000001490116119384765625, not 0.1. That is why 0.1 + 0.2 is not 0.3: the
rounding-error row tells you exactly how far the stored value sits from the number you
typed, and the ULP row shows how far apart neighbouring floats are at that magnitude.
Everything is computed in your browser with plain JavaScript. Nothing is uploaded, there is no sign-up, no ads, and no request leaves the page.
Frequently asked questions
What is 0.1 in IEEE 754?
In 32-bit single precision 0.1 is stored as 0x3DCCCCCD, which is exactly 0.100000001490116119384765625. In 64-bit double precision it is 0x3FB999999999999A, or 0.1000000000000000055511151231257827021181583404541015625. Neither is exactly 0.1, which is why 0.1 + 0.2 does not give 0.3.
How do you convert a float to its hex bit pattern?
Type the decimal number, pick half, single or double precision, and the tool shows the hex and binary pattern with the sign, exponent and mantissa split out. Paste a hex pattern such as 3F800000 into the second box to go the other way, or click any bit to flip it and watch the value change.
What do the sign, exponent and mantissa bits mean?
A binary32 float is 1 sign bit, 8 exponent bits stored with a bias of 127, and 23 mantissa bits. The value is (-1)^sign times 1.mantissa times 2^(exponent - 127). An exponent field of all zeros means zero or a subnormal number, and all ones means infinity or NaN. Binary16 uses 5 exponent bits with bias 15, binary64 uses 11 with bias 1023.