IEEE 754 Floating Point Converter
Enter a decimal number to see how a computer stores it as a 32-bit float and a 64-bit double, including the value actually held after rounding.
Result
0 01111011 10011001100110011001101
0 01111111011 1001100110011001100110011001100110011001100110011010
- Value stored as a 32-bit float
- 0.10000000149011612
- Value stored as a 64-bit double
- 0.1
- Float sign bit
- 0 (positive)
- Float exponent
- 01111011 = 123, so 2^-4
- Double exponent
- 01111111011 = 1019, so 2^-4
Formula
- Value = (−1)^sign × 1.mantissa × 2^(exponent − bias)
- Single precision: 1 sign bit, 8 exponent bits (bias 127), 23 mantissa bits
- Double precision: 1 sign bit, 11 exponent bits (bias 1023), 52 mantissa bits
How the IEEE 754 Floating Point Converter works
IEEE 754 is the standard nearly every computer uses for real numbers. A value is stored in binary scientific notation: a sign, a power of two and a fraction called the mantissa or significand.
Most decimal fractions cannot be written exactly in binary, just as one third cannot be written exactly in decimal. The stored value is the nearest representable number, which is why 0.1 + 0.2 does not equal 0.3 exactly in most programming languages.
Worked example
0.1 as a 32-bit float is 0x3DCCCCCD. The sign is 0, the exponent field is 123, meaning 2^−4, and the value actually stored is 0.10000000149011612.
Frequently asked questions
Why is 0.1 + 0.2 not equal to 0.3?
Neither 0.1 nor 0.2 has an exact binary representation. Each is rounded to the nearest double, and the sum of those rounded values is 0.30000000000000004.
How many decimal digits can a float hold?
A 32-bit float holds about 7 significant decimal digits and a 64-bit double about 15 to 17.
Related calculators
- Hex CalculatorAdd, subtract, multiply and divide hexadecimal, binary, octal or decimal numbers, and apply bitwise AND, OR and XOR. Results in all four bases.
- Binary Translator: Text to BinaryConvert text to binary code and binary back to text. Uses 8-bit bytes with UTF-8, so it handles ASCII and every other character.
- Hex Translator: Text to HexadecimalConvert text to hexadecimal bytes and hex back to text using UTF-8. Useful for reading hex dumps and encoding strings.
- Morse Code TranslatorTranslate text to Morse code and Morse code back to text. Supports letters, numbers and punctuation in International Morse Code.
- Base64 Encoder and DecoderEncode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe variant.
- Text to ASCII and Unicode ConverterConvert text to ASCII codes and Unicode code points in decimal and hex, or turn a list of character codes back into text.
- Caesar Cipher Encoder and SolverEncrypt or decrypt text with a Caesar shift cipher. Shows all 25 possible shifts so you can solve a cipher without knowing the key, including ROT13.
- Letter to Number Converter (A1Z26)Convert letters to their alphabet position numbers, where A is 1 and Z is 26, or convert numbers back to letters.
- Chmod CalculatorBuild Unix file permissions by ticking read, write and execute for owner, group and others. Get the octal number, symbolic notation and chmod command.
- Subnet CalculatorCalculate the network address, broadcast address, host range, subnet mask and number of hosts for any IPv4 address and CIDR prefix.
Related unit converters
Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.