Skip to content
Related Articles

Related Articles

How to Convert from Decimal to Binary?

View Discussion
Improve Article
Save Article
  • Last Updated : 19 Jan, 2022

The number system is one of the ways to represent numbers. Every number system has its own base or radix. For example, Binary, Octal, Decimal, and Hexadecimal Number systems are some of the number systems and are also used in microprocessor programming.

  • Binary Numbers – Base 2
  • Octal Numbers – Base 8
  • Decimal Numbers – Base 10
  • Hexadecimal Numbers – Base 16

These numbers are easy to convert from one system to other systems. One can convert decimal to binary, decimal to hex, decimal to octal, and vice versa. Here let’s learn how to convert decimal to binary number systems along with the conversion steps and examples.

Decimal to Binary Conversion

Before learning how to convert decimal to binary in a number system, let’s first understand what is a decimal number system and what is a binary number system.

Decimal Number System

The number system that has a base value of 10 is called Decimal Number System. Decimal Numbers are consist of the following digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Binary Number System

A binary Number System is a base-2 number system that uses two states 0 and 1 to represent a number. For example: 01, 111, etc.

All the decimal numbers have their corresponding binary numbers. These binary numbers are used in computer applications and used for programming or coding purposes. This is because binary digits, 0 and 1 are only understood by computers.

Steps for Decimal to Binary Conversion

For converting Decimal numbers into binary numbers, use different methods such as formula, division method, and so on. Here, use the remainder formula. Steps to convert decimal number to binary number using decimal to the binary formula are as follow,

Step 1: Divide the given decimal number by 2, find the remainder (Ri).

Step 2: Now divide the quotient (Qi) that is obtained in the above step by 2, find the remainder.

Step 3: Repeat the above steps 1 and 2, until 0 is obtained as a quotient.

Step 4: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1). thus binary conversion of the given decimal number will be obtained.

Let’s learn how to convert decimal to binary numbers using the Decimal to Binary formula with some examples.

Sample Problems

Question 1: Using decimal to binary formula, convert 2 decimal into a binary number.

Solution: 

Using decimal to binary formula, 

Step 1: Divide the number by 2, find the remainder:

2 ÷ 2 gives Q1 = 1, R1 = 0

Step 2: Divide Q1 by 2, find the remainder:

1 ÷ 2 gives Q2 = 0, R2 = 1

Step 3: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1), this is the binary conversion of the given decimal number: 10

Answer: Hence, 2 as binary is (10)2

Question 2: Using decimal to binary formula, convert 3 decimal into a binary number.

Solution: 

Using decimal to binary formula, 

Step 1: Divide the number by 3, find the remainder.

3 ÷ 2 gives Q1 = 1, R1 = 1

Step 2: Divide Q1 by 2, find the remainder.

1 ÷ 2 gives Q2 = 0, R2 = 1

Step 3: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1), this is the binary conversion of the given decimal number: 11

Answer: Hence, 3 as binary is (11)2

Question 3: Using decimal to binary formula, convert 4 decimal into a binary number.

Solution:

Using decimal to binary formula, 

Step 1: Divide the number by 4, find the remainder.

4 ÷ 2 gives Q1 = 2, R1 = 0

Step 2: Divide Q1 by 2, find the remainder.

2 ÷ 2 gives Q2 = 1, R2 = 0

Step 3: Divide Q2 by 2, find the remainder.

1 ÷ 2 gives Q3 = 0, R3 = 1

Step 4: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1), this is the binary conversion of the given decimal number: 100

Answer: Hence, 4 as binary is (100)2

Question 4: Using decimal to binary formula, convert 5 decimal into a binary number.

Solution:

Using decimal to binary formula, 

Step 1: Divide the number by 5, find the remainder.

5 ÷ 2 gives Q1 = 1, R1 = 1

Step 2: Divide Q1 by 2, find the remainder.

2 ÷ 2 gives Q2 = 1, R2 = 0

Step 3: Divide Q2 by 2, find the remainder.

1 ÷ 2 gives  Q3 = 0, R3 = 1

Step 4: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1), this is the binary conversion of the given decimal number: 101

Answer: Hence, 5 as binary is (101)2

Question 5: Using decimal to binary formula, convert 6 decimal into a binary number.

Solution:

Using decimal to binary formula,

Step 1: Divide the number by 6, find the remainder.

6 ÷ 2 gives Q1 = 2, R1 = 0

Step 2: Divide Q1 by 2, find the remainder.

3 ÷ 2 gives Q2 = 1, R2 = 1

Step 3: Divide Q2 by 2, find the remainder.

1 ÷ 2 gives Q3 = 0, R3 = 1

Step 4: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1), this is the binary conversion of the given decimal number: 110

Answer: Hence, 6 as binary is (110)2

Question 6: Using decimal to binary formula, convert 7 decimal into a binary number.

Solution:

Using decimal to binary formula, 

Step 1: Divide the number by 7, find the remainder.

7 ÷ 2 gives Q1 = 3, R1 = 1

Step 2: Divide  Q1 by 2, find the remainder.

3 ÷ 2 gives Q2 = 1, R2 = 1

Step 3: Divide Q2 by 2, find the remainder.

1 ÷ 2 gives Q3 = 0, R3 = 1

Step 4: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1), this is the binary conversion of the given decimal number: 111

Answer: Hence, 7 as binary is (111)2.

Question 7: Using decimal to binary formula, convert 8 decimal into a binary number.

Solution:

Using decimal to binary formula, 

Step 1: Divide the number by 8, find the remainder.

8 ÷ 2 gives Q1 = 2, R1 = 0

Step 2: Divide  Q1 by 2, find the remainder.

4 ÷ 2 gives Q2 = 1, R2 = 0

Step 3: Divide  Q2 by 2, find the remainder.

2 ÷ 2 gives Q3 = 0, R3 = 0

Step 4: Divide  Q3 by 2, find the remainder.

1 ÷ 2 gives Q4 = 0, R4 = 1

Step 5: Write down the remainder in the following manner: the last remainder is written first, followed by the rest in the reverse order (Rn, R(n – 1) …. R1), this is the binary conversion of the given decimal number: 1000

Answer: Hence, 8 as binary is (1000)2

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!