Type a decimal number to see exactly how it is stored as an IEEE 754 single (32-bit), double (64-bit) or half (16-bit) float. Click any bit to flip it, paste hex or binary to decode it, and see the exact stored value and the rounding error.
Last updated:
Try:
SignExponent Mantissa Click a bit to flip it
Advertisement
Advertisement
How to use the IEEE 754 Floating Point Converter
Pick the precision: 32-bit single (C float), 64-bit double (JavaScript number, C double) or 16-bit half.
Enter a decimal number such as 0.1, -2.5e-8 or 3.14159. Infinity, -0 and NaN work too.
Read the bits: the sign, exponent and mantissa are colored, and the hex and binary forms appear underneath.
Check the rounding error: the tool shows the exact value stored and how far it is from what you typed.
Experiment: click any bit to flip it, paste a hex pattern like 3DCCCCCD, or use the ±1 ULP buttons to walk to neighboring floats.
IEEE 754 formats at a glance
Half (binary16)
Single (binary32)
Double (binary64)
Total bits
16
32
64
Sign / exponent / fraction
1 / 5 / 10
1 / 8 / 23
1 / 11 / 52
Exponent bias
15
127
1023
Significant decimal digits
about 3.3
about 7.2
about 15.9
Largest finite value
65504
≈ 3.4028235 × 1038
≈ 1.7976931 × 10308
Smallest positive normal
≈ 6.10 × 10-5
≈ 1.18 × 10-38
≈ 2.23 × 10-308
Smallest positive subnormal
≈ 5.96 × 10-8
≈ 1.40 × 10-45
≈ 4.94 × 10-324
Machine epsilon (ULP of 1.0)
2-10 ≈ 9.77 × 10-4
2-23 ≈ 1.19 × 10-7
2-52 ≈ 2.22 × 10-16
Typical names
float16, fp16, half
float, f32, REAL
double, f64, JavaScript number
How to decode the bits by hand
For a normal number the value is (-1)sign × 1.fraction × 2exponent − bias. Take 0.1 as a single-precision float, hex 3DCCCCCD:
Binary: 0 01111011 10011001100110011001101.
Sign bit 0, so the number is positive.
Exponent field 01111011 = 123; subtract the bias 127 to get −4.
The fraction with the implicit leading 1 is 1.100110011001100110011012 ≈ 1.6000000238.
Value = 1.6000000238 × 2−4 = 0.100000001490116119384765625, which is 1.49 × 10−9 above 0.1.
Special patterns: an exponent field of all zeros means zero or a subnormal number (no implicit 1, exponent fixed at 1 − bias); all ones means infinity when the fraction is zero and NaN otherwise.
Common values
Value
Single (hex)
Double (hex)
1.0
3F800000
3FF0000000000000
0.5
3F000000
3FE0000000000000
0.1
3DCCCCCD
3FB999999999999A
−2.5
C0200000
C004000000000000
+0 / −0
00000000 / 80000000
0000000000000000 / 8000000000000000
+Infinity
7F800000
7FF0000000000000
NaN (quiet)
7FC00000
7FF8000000000000
Frequently asked questions
Why is 0.1 not exactly 0.1 in floating point?
0.1 has an infinitely repeating binary expansion (0.000110011001100…), just like 1/3 in decimal, so it must be rounded to the nearest value with 24 (single) or 53 (double) significant bits. As a double it is stored as exactly 0.1000000000000000055511151231257827… (55 significant digits in full), an error of about 5.55e-18.
How is a 32-bit float laid out?
A single-precision float has 1 sign bit, 8 exponent bits stored with a bias of 127, and 23 fraction bits. For normal numbers the value is (-1)^sign × 1.fraction × 2^(exponent - 127). A double has 1 sign bit, 11 exponent bits with a bias of 1023, and 52 fraction bits.
What is the hex representation of a float?
It is the 32 or 64 raw bits written as 8 or 16 hexadecimal digits, most significant first. For example 1.0 is 3F800000 as a float and 3FF0000000000000 as a double, and 0.1 is 3DCCCCCD as a float. This is the value you see in memory dumps (in big-endian order) or when using functions like Float.floatToIntBits.
What are subnormal (denormal) numbers?
When the exponent field is all zeros, the implicit leading 1 becomes 0 and the exponent is fixed at its minimum, which lets very small values fade gradually to zero. The smallest positive subnormal is about 1.4e-45 for single precision and 4.9e-324 for double precision.
How does IEEE 754 rounding work?
The default mode is round to nearest, ties to even: the exact value is rounded to the closest representable float, and if it lies exactly halfway between two floats the one whose last mantissa bit is 0 is chosen. This converter performs that rounding with exact integer arithmetic, so the result matches what a correct compiler or parseFloat produces.
What is the difference between positive and negative zero?
They differ only in the sign bit (00000000 vs 80000000 for single precision). They compare equal, but they behave differently in some operations, for example 1/+0 is +Infinity and 1/-0 is -Infinity.
What is a ULP?
A unit in the last place is the gap between a float and the next representable float. It grows with the exponent: for doubles near 1.0 it is 2^-52, about 2.22e-16, which is the familiar machine epsilon.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.