Decimal to Binary Converter
Convert decimal numbers (base-10) to binary numbers (base-2) instantly. Free online decimal to binary converter with conversion steps.
How to Convert Decimal to Binary?
Decimal to binary conversion transforms base-10 numbers (0-9) into base-2 numbers (using only 0 and 1). The conversion is done by repeatedly dividing the decimal number by 2 and recording the remainders.
Conversion steps:
1. Divide the decimal number by 2
2. Write down the remainder (0 or 1)
3. Divide the quotient by 2
4. Repeat until the quotient is 0
5. The binary number is the remainders read from bottom to top
Example: Convert 13 to binary:
13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Result: 1101 (reading remainders from bottom to top)
Why convert decimal to binary?
Converting decimal to binary is essential in computer science and digital electronics because:
1. Computers process data in binary format
2. Understanding binary helps in low-level programming
3. Binary is used in networking (IP addresses, subnetting)
4. Digital circuits operate with binary signals
5. Memory addresses and data storage use binary
6. Bitwise operations require binary understanding
What's the fastest way to convert decimal to binary?
The division-by-2 method is the most common:
1. Divide the number by 2
2. Record the remainder
3. Use the quotient for the next division
4. Repeat until quotient is 0
5. Read remainders from bottom to top
Alternatively, you can use powers of 2:
1. Find the largest power of 2 that fits in your number
2. Subtract it and place a 1 in that bit position
3. Repeat for the remainder
4. Fill remaining positions with 0
Can I convert negative numbers to binary?
Yes, but it requires understanding signed binary representations:
1. Sign-Magnitude: First bit indicates sign (0=positive, 1=negative)
2. One's Complement: Flip all bits of the positive binary
3. Two's Complement (most common): Flip all bits and add 1
Example: -13 in 8-bit two's complement:
13 = 00001101
Flip bits: 11110010
Add 1: 11110011
Result: -13 = 11110011
What's the binary equivalent of decimal 255?
255 in binary is 11111111 (eight 1s). This is significant because:
- It's the maximum value for an 8-bit unsigned integer
- All bits are set to 1
- It's commonly used as a subnet mask (255.255.255.0)
- It's the maximum value for one byte
- In hexadecimal, it's FF
Common Decimal to Binary Conversions
Decimal | Binary |
---|---|
0 | 0 |
1 | 1 |
2 | 10 |
3 | 11 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
8 | 1000 |
9 | 1001 |
10 | 1010 |
15 | 1111 |
16 | 10000 |
31 | 11111 |
32 | 100000 |
63 | 111111 |
64 | 1000000 |
127 | 1111111 |
128 | 10000000 |
255 | 11111111 |