Convert a decimal fraction to binary by repeated multiplication by two. Values like 0.1 have NO finite binary form – this tool detects the repeating digits and shows them in parentheses.
Show calculation steps
Processed privately in your browser β nothing you paste is uploaded, logged or stored.
The conversion that breaks 0.1
Encoding a decimal fraction in binary is where floating-point folklore comes from. The algorithm is innocent β repeatedly double the fraction and collect the integer parts as digits β but most decimal fractions never finish: 0.1 doubles into a four-digit cycle (0011) that repeats forever, because 1/10 has the prime factor 5 and binary has only 2s.
This page runs the doubling exactly and detects the cycle the moment a remainder recurs β the repeating block appears in parentheses, a mathematical certainty rather than a guess.
Worked example
Input: 5.625
Integer: 5 β 101
Fraction: 0.625 Γ 2 = 1.25 β 1 (keep .25)
0.25 Γ 2 = 0.5 β 0
0.5 Γ 2 = 1.0 β 1 (done)
Result: 101.101 β terminates, because 0.625 = 5/8 and 8 = 2Β³Terminating or repeating β the rule
Reduce the fraction: if the denominator is a pure power of two, the binary form terminates; any other prime factor forces an infinite repeat. Eighths and sixty-fourths terminate. Tenths, fifths and thirds repeat. That one rule predicts every float-rounding surprise you will ever debug.
Practical consequences
Choosing fixed-point formats (how many fraction bits until the error is tolerable?), understanding why monetary arithmetic uses integers or decimal types, generating exact test vectors for hardware, and explaining 0.1 + 0.2 β 0.3 in a code review β all start with seeing the true expansion this page produces.
Precision policy and privacy
You choose the displayed digit budget; the arithmetic itself is exact rational throughout, and truncation is labelled when the expansion outruns the budget without terminating or cycling. Conversion is local β your numbers stay in the browser.
How to use the Decimal Fraction to Binary Converter
- Enter a decimal number with a fractional part, such as 5.625 or 0.1.
- Choose the maximum fraction digits to display.
- Click "Convert to binary".
- If the digits repeat forever, the repeating block appears in parentheses and a note explains why.
Frequently asked questions
How does the fractional part convert?
By repeated doubling: multiply the fraction by 2; the integer part (0 or 1) is the next binary digit; keep the remainder and repeat. 0.625 β 1.25 β digit 1; 0.25 β 0.5 β digit 0; 0.5 β 1.0 β digit 1: so 0.625 = .101 exactly.
Why does 0.1 never terminate in binary?
Because 0.1 = 1/10 and 10 has the prime factor 5, which 2 lacks. Only fractions whose reduced denominator is a pure power of two terminate in binary. The tool detects the repeat exactly: 0.1 = 0.0(0011), with 0011 recurring forever.
Is this why 0.1 + 0.2 !== 0.3 in programming?
Precisely. A float stores a rounded, finite slice of that infinite expansion; three such roundings do not line up. This converter shows the true expansion, and the IEEE-754 converter shows the exact rounded value your language actually stores.
What does the precision option limit?
Only the display length. The arithmetic is exact rational underneath – if the expansion neither terminates nor starts repeating within your limit, the output says "truncated" honestly instead of implying completeness.
Can I convert a whole number with this page?
You can – 7 converts to 111 – but without a fractional part the dedicated Decimal to Binary converter gives you the repeated-division steps, which are more instructive for integers.
How is the repeating block detected, not guessed?
The tool tracks each remainder produced during the doubling process. The first time a remainder recurs, the digits since its first appearance form the cycle – a mathematical certainty, not a pattern match on digits.
What practical work needs this conversion?
Choosing fixed-point formats for embedded code (how many fraction bits does 0.001 need?), understanding float rounding, generating test vectors for hardware, and DSP coefficient scaling.