IEEE 754 Floating Point Converter
Online IEEE 754 floating point converter supporting single precision (32-bit) and double precision (64-bit), converting between decimal, hexadecimal and binary with a visual breakdown of the sign, exponent and mantissa bits.
FreeOnline Tool
Loading…
How to Use
- Choose the precision: single precision 32-bit or double precision 64-bit.
- From decimal: type a number into the decimal box (such as 3.14, -0.1 or 1e-7) and it is converted to hexadecimal and a binary bit map automatically.
- From hexadecimal: type a memory value into the hexadecimal box (such as 0x40490FDB) and it is decoded back to a decimal value.
- Study the bit map below, where the sign, exponent and mantissa segments are highlighted separately and hovering shows what each means.
Special values: enter Infinity, -Infinity or NaN to see their IEEE 754 representation.
Features
- Faithful IEEE 754 implementation: single precision (32-bit) and double precision (64-bit) conversion strictly following the IEEE 754-2008 standard.
- Three-way conversion: decimal fraction, hexadecimal memory representation and binary bit string, where entering any one produces the other two.
- Bit-level visualization: the sign, exponent and mantissa segments are highlighted separately, showing the IEEE 754 storage layout at a glance.
- Special value support: handles +0, -0, +Infinity, -Infinity, NaN and subnormal numbers correctly.
- Precision comparison: shows single and double precision results together so you can see where precision is lost.
Use Cases
Embedded development and debugging
Embedded engineers can take a floating point value out of a register and decode the hexadecimal straight to its real numeric value.
Learning a programming language
While learning floating point types in C, C++ or Java, see concretely how float and double differ in precision and memory layout.
Investigating precision problems
Track down issues such as 0.1+0.2 not equaling 0.3 by inspecting exactly where the binary approximation error comes from.
Graphics shader development
Verify that the bit-level representation of half or float precision matches expectations while writing GPU shaders.
FAQ
Why does 0.1 + 0.2 not equal 0.3?
This is inherent to IEEE 754 floating point. Both 0.1 and 0.2 are infinitely repeating fractions in binary, so they are truncated to approximations when stored, and the error in those approximations means the sum is not exactly 0.3. Enter 0.1 in this tool to see its actual binary representation.
What is the difference between single and double precision?
Single precision (float) uses 32 bits, giving roughly 7 significant decimal digits and an exponent range of about ±38. Double precision (double) uses 64 bits, giving roughly 15 to 16 significant digits and a range of about ±308. Most languages default to double, while embedded and graphics work often uses single precision to save memory.
What is the exponent bias?
IEEE 754 stores the exponent with a bias, 127 for single precision and 1023 for double. The actual exponent equals the stored value minus the bias, so a stored 127 (0111 1111) represents an exponent of 0, that is 2^0 = 1. This design lets floating point values be compared in the same order as integers.
There are many kinds of NaN. Which one is shown here?
JavaScript's NaN is a quiet NaN, which is 0x7FC00000 in single precision and 0x7FF8000000000000 in double. Signaling NaN values are automatically converted to quiet NaN in a JavaScript environment.