Binary Fraction Converter

Your details

Choose which way to convert.
Any non-negative decimal value, e.g. 0.625 or 13.5.
Maximum number of bits used for the fractional part. More bits = more precision, less rounding error.
Result
0.101

The converted value in the target number system.

Integer bits1
Fractional bits used3
Rounding error0
Repeating patternNo - terminates exactly
Integer bits1
Fractional bits3

0.625 in decimal = 0.101 in binary

  • The decimal 0.625 has an exact binary representation. This only happens when the denominator of the fraction (when fully reduced) has 2 as its only prime factor (e.g. 1/2, 1/4, 1/8).
  • The fractional part required 3 bits. In a 32-bit IEEE 754 float, 23 bits are available for the significand fraction.
  • Understanding binary fractions is essential for computer science: floating-point arithmetic, fixed-point DSP, and data serialization all rely on this conversion.

Next stepTry entering 0.1, 0.2, and 0.3 to see why they produce repeating binary fractions, and why 0.1 + 0.2 does not equal exactly 0.3 in floating-point arithmetic.

= Powered by OnlyCalculators