Calcoid

IEEE 754 Floating Point Calculator

Convert decimal numbers to IEEE 754 binary formats and inspect sign, exponent, fraction, hex, and special values.

Encode a decimal number

Try values like 0.15625, 85.125, or 0.1 to see rounding behavior.

Encoding

0.15625

Single-precision hex 3E200000 | double-precision hex 3FC4000000000000

Single precision (binary32)

Sign
0positive
Exponent
01111100124 - bias = -3
Mantissa
0100000000000000000000023 fraction bits

Binary

0 01111100 01000000000000000000000

Hexadecimal

0x3E200000

Double precision (binary64)

Sign
0positive
Exponent
011111111001020 - bias = -3
Mantissa
010000000000000000000000000000000000000000000000000052 fraction bits

Binary

0 01111111100 0100000000000000000000000000000000000000000000000000

Hexadecimal

0x3FC4000000000000

Frequently Asked Questions about the IEEE 754 Floating Point Calculator

What does the IEEE 754 floating point calculator do?
It converts a decimal number into its IEEE 754 binary representation and breaks the bits into the three fields the standard defines: sign, exponent, and mantissa (also called the fraction). You get both single precision (32-bit, binary32) and double precision (64-bit, binary64) at once, shown in binary and hex. It also works in reverse, decoding a hex bit pattern back to the decimal value it stores.
How are single and double precision different?
Single precision uses 32 bits: 1 sign bit, 8 exponent bits, and 23 mantissa bits, with an exponent bias of 127. Double precision uses 64 bits: 1 sign bit, 11 exponent bits, and 52 mantissa bits, with a bias of 1023. Double precision gives you roughly 15 to 17 significant decimal digits versus about 6 to 9 for single, so the same value usually stores more accurately as a double.
How does IEEE 754 encode a number?
For a normal value the formula is (-1)^sign times 1.mantissa times 2 to the power of (stored exponent minus bias). The number is first written in binary scientific notation, the leading 1 is dropped because it is implied, and the remaining fraction bits become the mantissa. The exponent is stored with the bias added so it can represent both negative and positive powers without a separate sign.
Why does 0.1 not store exactly?
0.1 has no finite representation in base 2, the same way 1/3 has no finite representation in base 10. The hardware rounds it to the nearest value it can store, which in single precision is the bit pattern 0x3DCCCCCD. Try entering 0.1 in encode mode to see the repeating mantissa pattern that causes the small error you sometimes notice in floating point math.
What are subnormal numbers, infinity, and NaN?
When the exponent field is all zeros and the mantissa is nonzero, the value is subnormal (denormalized), which lets the format represent numbers closer to zero by dropping the implied leading 1. When the exponent field is all ones, a zero mantissa means infinity and a nonzero mantissa means NaN (not a number). The calculator labels each of these special cases when it detects them.
Which byte order does the calculator use for the hex?
The hex and binary output is shown in big-endian (most significant bit first), which is the standard way IEEE 754 layouts are written in textbooks and documentation. That means the sign bit is on the left, followed by the exponent field, then the mantissa. Stored byte order in memory depends on your CPU, but the logical bit pattern shown here is the same on every platform.

Related Calculators

More calculators in "Tech"

See all 98 calculators in "Tech"