Base Conversion Process

This page shows step-by-step how to convert numbers between decimal and binary.

Binary and Decimal as Positional Number Systems

17910 = (1×100) + (7×10) + (9×1)

Decimal digits:179
Position value:100101

11012 = (1×8) + (1×4) + (0×2) + (1×1) = 1310

Binary digits:1101
Position value:8421

Example: Decimal 45 → Binary

1. Write position values (powers of 2) from right to left. Stop before exceeding the decimal number. We stop at 32 because 64, the next power of 2, is larger than 45.

??????
32168421

2. Start on the left and place a 1 if that power of two (32) can be subtracted from 45. Otherwise, put a 0.

3. Subtract that power of 2 from 45. 45 − 32 = 13.

4. Next, repeat for each power of 2 with the number you have left after you subtract. Since 16 is larger than 13, we put a 0. Then we see that 13 − 8 = 5, so we will place a 1 in the 8’s position. Next, 5- 4= 1; skip 2, write a 1.

101101
32168421

Final answer: 4510 = 1011012

Example: Binary 00010101 → Decimal

1. Write binary digits (ignore leading 0’s). → 10101

2. Write position values below (right to left).

10101
168421

3. Multiply each position value with the digit and sum: (1×16) + (0×8) + (1×4) + (0×2) + (1×1) = 21

Final answer: 2110 = 000101012

Exercises

Convert:

Binary → Decimal

A. 00010100
B. 10110101
C. 01011011
D. 10111010

Decimal → Binary

A. 42
B. 75
C. 145
D. 250

Answers

Binary → Decimal: A. 20  B. 181  C. 91  D. 186
Decimal → Binary: A. 101010  B. 1001011  C. 10010001  D. 11111010