Floating Point Calculator
Computers store most non-integer numbers in floating-point format, and the IEEE 754 standard defines exactly how. A single-precision float uses 32 bits split into three parts: one sign bit, an eight-bit exponent stored with a bias of 127, and a 23-bit fraction called the mantissa. The value is the sign times one point the mantissa times two raised to the exponent minus the bias, a form that lets a fixed number of bits represent a huge range of magnitudes. This calculator takes a decimal number and shows how it is encoded as an IEEE 754 single-precision float. It reports the full 32-bit pattern in binary and hexadecimal, the sign bit, the stored exponent and its unbiased value, so you can see how the number is laid out in memory. This encoding explains why some decimals cannot be stored exactly and why floating-point arithmetic has rounding. You enter any decimal value and the calculator returns its single-precision encoding. Every figure is computed deterministically from the IEEE 754 rules applied to your input, never guessed, so the same number always produces the same bit pattern. The encoding and a worked example that reconciles to the calculator default are shown in full below.
An IEEE 754 single-precision float is sign, 8-bit exponent (bias 127) and 23-bit mantissa. The default 0.15625 encodes to the hex pattern 3E200000, with exponent -3 and value 1.25 x 2^-3.
Formula
value = (-1)^sign x 1.mantissa x 2^(exponent - 127)
sign: 1 bit | exponent: 8 bits (bias 127) | mantissa: 23 bits
Total width: 32 bits (single precision)
The number is normalised to one point something times a power of two. The sign goes in the top bit, the exponent plus the bias of 127 goes in the next eight bits, and the fractional mantissa fills the remaining 23 bits.
Worked example
Encode the decimal 0.15625 as a single-precision float.
- 0.15625 = 1.25 x 2^-3, so the sign is 0 (positive)
- Exponent = -3 + 127 = 124 = 01111100 in binary
- Mantissa for 1.25 is .25 = 01000... (23 bits)
- Bits: 0 01111100 01000000000000000000000 = hex 3E200000
This is the calculator's default value, so the hex pattern 3E200000 matches the widget exactly.
Floating Point Calculator: frequently asked questions
What is IEEE 754 single precision?
It is the standard 32-bit floating-point format: one sign bit, an eight-bit exponent with a bias of 127, and a 23-bit mantissa. It is the float type used by most programming languages.
Why use a bias on the exponent?
The bias of 127 lets the eight-bit exponent represent both negative and positive powers of two without a separate sign, by storing the actual exponent plus 127.
Why can some decimals not be stored exactly?
Only fractions whose values fit a sum of powers of two within 23 mantissa bits are exact. Others, like 0.1, must be rounded, which is the source of small floating-point errors.
What is the mantissa?
The mantissa, or significand, holds the fractional digits after the implied leading 1. Together with the exponent it sets the precise value of the number.
Is the encoding reproducible?
Yes. The IEEE 754 rules are fully specified, so the same decimal always encodes to the same 32-bit pattern on any compliant system.
Official sources
- Floating-point arithmetic standard reference: US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.