Convert decimal numbers (including floating point) to binary instantly. Supports integer and fractional decimal numbers with high precision.
Converting decimal numbers to binary involves different methods for the integer and fractional parts. The integer part uses repeated division by 2, while the fractional part uses repeated multiplication by 2.
Key Concept: Binary is a base-2 numeral system, meaning it uses only two digits: 0 and 1. Each binary digit (bit) represents a power of 2.
Integer Part: Repeatedly divide the integer by 2 and record the remainders. The binary equivalent is the remainders read in reverse order.
Fractional Part: Repeatedly multiply the fraction by 2. The integer part of each result becomes a binary digit. Continue with the fractional part.
Example (13): 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1 → Binary: 1101 (read remainders backwards)
Important Note: Two's complement representation is only for integers. For signed fractional numbers, use IEEE 754 floating point representation.
| Decimal | Binary | Power of 2 |
|---|---|---|
| 0 | 0 | - |
| 1 | 1 | 20 |
| 2 | 10 | 21 |
| 4 | 100 | 22 |
| 8 | 1000 | 23 |
| 16 | 10000 | 24 |
| 32 | 100000 | 25 |
| 64 | 1000000 | 26 |
| 128 | 10000000 | 27 |
| 255 | 11111111 | 28-1 |
| 0.5 | 0.1 | 2-1 |
| 0.25 | 0.01 | 2-2 |
| 0.125 | 0.001 | 2-3 |
| 0.0625 | 0.0001 | 2-4 |
| 5.625 | 101.101 | 4 + 1 + 0.5 + 0.125 |
0
0
1
1
2
10
5
101
10
1010
255
11111111
0.5
0.1
0.25
0.01
1.5
1.1
5.625
101.101