Many simple decimal fractions, such as 0.1, have no finite binary form – they repeat forever. That is why 0.1 + 0.2 ≠ 0.3 in most programming languages, and why money is stored in cents.
How to use the Binary Fraction Calculator
- Conversion
- Number
- Fractional bits (decimal → binary)
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Choose the direction. Decimal to binary multiplies the fractional part by 2 repeatedly, taking the integer part as the next bit, up to the chosen number of bits.
Formula
0.b₁b₂b₃…₂ = b₁·2⁻¹ + b₂·2⁻² + b₃·2⁻³ + …
Decimal → binary: multiply the fraction by 2, the integer part is the next bit
Worked example
Inputs — Conversion: Decimal → binary; Number: 0.1; Fractional bits (decimal → binary): 12.
Results — Result = 0.000110011001; Exactness = Truncated after 12 fractional bits (the exact expansion is longer); Steps = 0.1 × 2 = 0.2 → 0
0.2 × 2 = 0.4 → 0
0.4 × 2 = 0.8 → 0
0.8 × 2 = 1.6 → 1
0.6 × 2 = 1.2 → 1
0.2 × 2 = 0.4 → 0
0.4 × 2 = 0.8 → 0
0.8 × 2 = 1.6 → 1
0.6 × 2 = 1.2 → 1
0.2 × 2 = 0.4 → 0
0.4 × 2 = 0.8 → 0
0.8 × 2 = 1.6 → 1.
Key terms
- Binary point
- The binary equivalent of the decimal point.
Frequently asked questions
Why can't 0.1 be stored exactly in binary?
Its binary expansion 0.000110011… repeats forever.
Which decimal fractions are exact in binary?
Those whose denominator is a power of 2, like 0.5, 0.25 and 0.375.
What is 0.101₂ in decimal?
0.625.
How many bits does a double have for the fraction?
52.