Convert Binary to Decimal and Decimal to Binary Numbers
Table of Contents
Convert Binary to Decimal Numbers
A tutorial on how to convert decimal to binary and binary to decimal numbers with full explanations, exercises and answers.
The digits 0, 1, … 9 are to write any number in the decimal system. Likewise, we use 0 and 1 to write numbers in the binary number system.
In decimal number system which is also called the base10 system
, the decimal number 149 is written as follows:
149 = 1*10^{2} + 4*10^{1} + 9*10^{0}
The binary or base2 number 1 0 0 1 0 1 0 1
can be converted to a decimal number as follows:
1*2^{7} + 0*2^{6} + 0*2^{5} + 1*2^{4} + 0*2^{3} + 1*2^{2} + 0*2^{1} + 1*2^{0}
= 128 + 16 + 4 + 1
= 149
The binary number 1 0 0 1 0 1 0 1 is written as 149 in the decimal system.
Convert Decimal Numbers to Binary
To convert a decimal number into a binary number, we carry out successive divisions by 2 and use the reminders of the successive divisions.
Example: Convert the decimal number 123 to a binary number.
123 ÷ 2 = 61 , reminder = 1 , least significant bit, goes to the right.
61 ÷ 2 = 30 , reminder = 1
30 ÷ 2 = 15 , reminder = 0
15 ÷ 2 = 7 , reminder = 1
7 ÷ 2 = 3 , reminder = 1
3 ÷ 2 = 1 , reminder = 1
1 ÷ 2 = 0 , reminder = 1 , Most significant bit, goes to the left.
The decimal number 123 in written as 1 1 1 1 0 1 1 in binary.
We can easily check by converting 1 1 1 1 0 1 1 into decimal as follows:
1*2^{6} + 1*2^{5} + 1*2^{4} + 1*2^{3} + 0*2^{2} + 1*2^{1} + 1*2^{0} = 64 + 32 + 16 + 8 + 2 + 1 = 123
A
Decimal to Binary Converter that may be used to convert decimal numbers to binary form.
Exercises with Answers
A  Convert the binary numbers into decimal numbers
 11
 101
 1111
 110111011
 1111100011110011
B  Convert the decimal numbers into binary numbers
 7
 13
 128
 1678
 12359
Answers to Above Exercises
A  Convert the binary numbers into decimal numbers
 11 = 1*2^{1} + 1*2^{0} = 2 + 1 = 3
 101 = 1*2^{2} + 0*2^{1} + 1*2^{0}
= 4 + 1
= 5
 1111 = 1*2^{3} + 1*2^{2} + 1*2^{1} + 1*2^{0}
= 8 + 4 + 2 + 1
= 15
 110111011 = 1*2^{8} + 1*2^{7} + 0*2^{6} + 1*2^{5} + 1*2^{4} + 1*2^{3} + 0*2^{2} + 1*2^{1} + 1*2^{0}
= 256 + 128 + 32 + 16 + 8 + 2 + 1
= 443
 1111100011110011 = 1*2^{15} + 1*2^{14} + 1*2^{13} + 1*2^{12} + 1*2^{11} + 0*2^{10} + 0*2^{9} + 0*2^{8} + 1*2^{7} + 1*2^{6} + 1*2^{5} + 1*2^{4} + 0*2^{3} + 0*2^{2} + 1*2^{1} + 1*2^{0}
= 32768 + 16384 + 8192 + 4096 + 2048 + 128 + 64 + 32 + 16 + 2 + 1
= 63731
B  Convert the decimal numbers into binary numbers
In what follows r means the reminder of the division.

7 ÷ 2 = 3 , r = 1
3 ÷ 2 = 1 , r = 1
1 ÷ 2 = 0 , r = 1
Hence 7 in binary is written as 111

13 ÷ 2 = 6 , r = 1
6 ÷ 2 = 3 , r = 0
3 ÷ 2 = 1 , r = 1
1 ÷ 2 = 0 , r = 1
Hence 13 in binary is written as 1101

128 ÷ 2 = 64 , r = 0
64 ÷ 2 = 32 , r = 0
32 ÷ 2 = 16 , r = 0
16 ÷ 2 = 8 , r = 0
8 ÷ 2 = 4 , r = 0
4 ÷ 2 = 2 , r = 0
2 ÷ 2 = 1 , r = 0
1 ÷ 2 = 0 , r = 1
Hence 128 in binary is written as 10000000

1678 ÷ 2 = 839 , r = 0
839 ÷ 2 = 419 , r = 1
419 ÷ 2 = 209 , r = 1
209 ÷ 2 = 104 , r = 1
104 ÷ 2 = 52 , r = 0
52 ÷ 2 = 26 , r = 0
26 ÷ 2 = 13 , r = 0
13 ÷ 2 = 6 , r = 1
6 ÷ 2 = 3 , r = 0
3 ÷ 2 = 1 , r = 1
1 ÷ 2 = 0 , r = 1
Hence 1678 in binary is written as 11010001110

12359 ÷ 2 = 6179 , r = 1
6179 ÷ 2 = 3089 , r = 1
3089 ÷ 2 = 1544 , r = 1
1544 ÷ 2 = 772 , r = 0
772 ÷ 2 = 386 , r = 0
386 ÷ 2 = 193 , r = 0
193 ÷ 2 = 96 , r = 1
96 ÷ 2 = 48 , r = 0
48 ÷ 2 = 24 , r = 0
24 ÷ 2 = 12 , r = 0
12 ÷ 2 = 6 , r = 0
6 ÷ 2 = 3 , r = 0
3 ÷ 2 = 1 , r = 1
1 ÷ 2 = 0 , r = 1
Hence 12359 in binary form is written as follows 11000001000111